libopenmpt_ext_impl.hpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * libopenmpt_ext_impl.hpp
  3. * -----------------------
  4. * Purpose: libopenmpt extensions - implementation header
  5. * Notes :
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #ifndef LIBOPENMPT_EXT_IMPL_HPP
  10. #define LIBOPENMPT_EXT_IMPL_HPP
  11. #include "libopenmpt_internal.h"
  12. #include "libopenmpt_impl.hpp"
  13. #include "libopenmpt_ext.hpp"
  14. namespace openmpt {
  15. class module_ext_impl
  16. : public module_impl
  17. , public ext::pattern_vis
  18. , public ext::interactive
  19. , public ext::interactive2
  20. /* add stuff here */
  21. {
  22. public:
  23. module_ext_impl( callback_stream_wrapper stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  24. module_ext_impl( std::istream & stream, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  25. module_ext_impl( const std::vector<std::byte> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  26. module_ext_impl( const std::vector<std::uint8_t> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  27. module_ext_impl( const std::vector<char> & data, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  28. module_ext_impl( const std::byte * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  29. module_ext_impl( const std::uint8_t * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  30. module_ext_impl( const char * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  31. module_ext_impl( const void * data, std::size_t size, std::unique_ptr<log_interface> log, const std::map< std::string, std::string > & ctls );
  32. private:
  33. /* add stuff here */
  34. private:
  35. void ctor();
  36. public:
  37. ~module_ext_impl();
  38. public:
  39. void * get_interface( const std::string & interface_id );
  40. // pattern_vis
  41. effect_type get_pattern_row_channel_volume_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const override;
  42. effect_type get_pattern_row_channel_effect_type( std::int32_t pattern, std::int32_t row, std::int32_t channel ) const override;
  43. // interactive
  44. void set_current_speed( std::int32_t speed ) override;
  45. void set_current_tempo( std::int32_t tempo ) override;
  46. void set_tempo_factor( double factor ) override;
  47. double get_tempo_factor( ) const override;
  48. void set_pitch_factor( double factor ) override;
  49. double get_pitch_factor( ) const override;
  50. void set_global_volume( double volume ) override;
  51. double get_global_volume( ) const override;
  52. void set_channel_volume( std::int32_t channel, double volume ) override;
  53. double get_channel_volume( std::int32_t channel ) const override;
  54. void set_channel_mute_status( std::int32_t channel, bool mute ) override;
  55. bool get_channel_mute_status( std::int32_t channel ) const override;
  56. void set_instrument_mute_status( std::int32_t instrument, bool mute ) override;
  57. bool get_instrument_mute_status( std::int32_t instrument ) const override;
  58. std::int32_t play_note( std::int32_t instrument, std::int32_t note, double volume, double panning ) override;
  59. void stop_note( std::int32_t channel ) override;
  60. void note_off( std::int32_t channel ) override;
  61. void note_fade( std::int32_t channel ) override;
  62. void set_channel_panning( std::int32_t channel, double panning ) override;
  63. double get_channel_panning( std::int32_t channel ) override;
  64. void set_note_finetune( std::int32_t channel, double finetune ) override;
  65. double get_note_finetune( std::int32_t channel ) override;
  66. /* add stuff here */
  67. }; // class module_ext_impl
  68. } // namespace openmpt
  69. #endif // LIBOPENMPT_EXT_IMPL_HPP