libopenmpt: libopenmpt/libopenmpt.hpp Source File

libopenmpt 0.8.8-pre.0+r25466 cross-platform C++ and C library to decode tracked music files

libopenmpt.hpp
Go to the documentation of this file.
1/*
2 * libopenmpt.hpp
3 * --------------
4 * Purpose: libopenmpt public c++ interface
5 * Notes : (currently none)
6 * Authors: OpenMPT Devs
7 * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
8 */
9
10#ifndef LIBOPENMPT_HPP
11#define LIBOPENMPT_HPP
12
13#include "libopenmpt_config.h"
14
15#include <exception>
16#include <iosfwd>
17#include <iostream>
18#include <map>
19#include <string>
20#include <string_view>
21#include <vector>
22
23#include <cstddef>
24#include <cstdint>
25
130 namespace openmpt {
131
136#if defined(_MSC_VER)
137#pragma warning(push)
138#pragma warning(disable:4275)
139#endif
141
145 class LIBOPENMPT_CXX_API_CLASS exception : public std::exception {
146private:
147 char * text;
148public:
149 LIBOPENMPT_CXX_API_MEMBER exception( const std::string & text ) noexcept;
150 LIBOPENMPT_CXX_API_MEMBER exception( const exception & other ) noexcept;
151 LIBOPENMPT_CXX_API_MEMBER exception( exception && other ) noexcept;
152 LIBOPENMPT_CXX_API_MEMBER exception & operator = ( const exception & other ) noexcept;
153 LIBOPENMPT_CXX_API_MEMBER exception & operator = ( exception && other ) noexcept;
154 LIBOPENMPT_CXX_API_MEMBER virtual ~exception() noexcept;
155 LIBOPENMPT_CXX_API_MEMBER const char * what() const noexcept override;
156}; // class exception
157#if defined(_MSC_VER)
158#pragma warning(pop)
159#endif
160
162
167LIBOPENMPT_CXX_API std::uint32_t get_library_version();
168
170
174LIBOPENMPT_CXX_API std::uint32_t get_core_version();
175
176 namespace string {
177
179 static const char library_version LIBOPENMPT_ATTR_DEPRECATED [] = "library_version";
181static const char library_features LIBOPENMPT_ATTR_DEPRECATED [] = "library_features";
183static const char core_version LIBOPENMPT_ATTR_DEPRECATED [] = "core_version";
185static const char build LIBOPENMPT_ATTR_DEPRECATED [] = "build";
187static const char credits LIBOPENMPT_ATTR_DEPRECATED [] = "credits";
189static const char contact LIBOPENMPT_ATTR_DEPRECATED [] = "contact";
191static const char license LIBOPENMPT_ATTR_DEPRECATED [] = "license";
192
194
222LIBOPENMPT_CXX_API std::string get( const std::string & key );
223
224} // namespace string
225
227
230LIBOPENMPT_CXX_API std::vector<std::string> get_supported_extensions();
231
233
238 LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API bool is_extension_supported( const std::string & extension );
240
245LIBOPENMPT_CXX_API bool is_extension_supported2( std::string_view extension );
246
248
260LIBOPENMPT_CXX_API double could_open_probability( std::istream & stream, double effort = 1.0, std::ostream & log = std::clog );
261
263
266 LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API double could_open_propability( std::istream & stream, double effort = 1.0, std::ostream & log = std::clog );
267
269
273LIBOPENMPT_CXX_API std::size_t probe_file_header_get_recommended_size();
274
276 static const std::uint64_t probe_file_header_flags_modules LIBOPENMPT_ATTR_DEPRECATED = 0x1ull;
277
279static const std::uint64_t probe_file_header_flags_containers LIBOPENMPT_ATTR_DEPRECATED = 0x2ull;
280
282static const std::uint64_t probe_file_header_flags_default LIBOPENMPT_ATTR_DEPRECATED = 0x1ull | 0x2ull;
283
285static const std::uint64_t probe_file_header_flags_none LIBOPENMPT_ATTR_DEPRECATED = 0x0ull;
286
288 enum probe_file_header_flags : std::uint64_t {
290 probe_file_header_flags_modules2 = 0x1ull,
292 probe_file_header_flags_containers2 = 0x2ull,
294 probe_file_header_flags_default2 = probe_file_header_flags_modules2 | probe_file_header_flags_containers2,
296 probe_file_header_flags_none2 = 0x0ull
297};
298
300 enum probe_file_header_result {
302 probe_file_header_result_success = 1,
304 probe_file_header_result_failure = 0,
306 probe_file_header_result_wantmoredata = -1
307};
308
310
324LIBOPENMPT_CXX_API int probe_file_header( std::uint64_t flags, const std::byte * data, std::size_t size, std::uint64_t filesize );
326
340LIBOPENMPT_CXX_API int probe_file_header( std::uint64_t flags, const std::uint8_t * data, std::size_t size, std::uint64_t filesize );
341
343
357LIBOPENMPT_CXX_API int probe_file_header( std::uint64_t flags, const std::byte * data, std::size_t size );
359
373LIBOPENMPT_CXX_API int probe_file_header( std::uint64_t flags, const std::uint8_t * data, std::size_t size );
374
376
388LIBOPENMPT_CXX_API int probe_file_header( std::uint64_t flags, std::istream & stream );
389
390class module_impl;
391
392class module_ext;
393
394namespace detail {
395
396typedef std::map< std::string, std::string > initial_ctls_map;
397
398} // namespace detail
399
400 class LIBOPENMPT_CXX_API_CLASS module {
401
402 friend class module_ext;
403
404public:
405
407 enum render_param {
409
414 RENDER_MASTERGAIN_MILLIBEL = 1,
416
421 RENDER_STEREOSEPARATION_PERCENT = 2,
423
434 RENDER_INTERPOLATIONFILTER_LENGTH = 3,
436
443 RENDER_VOLUMERAMPING_STRENGTH = 4
444 };
445
447 enum command_index {
448 command_note = 0,
449 command_instrument = 1,
450 command_volumeffect = 2,
451 command_effect = 3,
452 command_volume = 4,
453 command_parameter = 5
454 };
455
456private:
457 module_impl * impl;
458private:
459 // non-copyable
460 module( const module & );
461 void operator = ( const module & );
462private:
463 // for module_ext
464 module();
465 void set_impl( module_impl * i );
466public:
468
476 LIBOPENMPT_CXX_API_MEMBER module( std::istream & stream, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
486 LIBOPENMPT_CXX_API_MEMBER module( const std::vector<std::byte> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
497 LIBOPENMPT_CXX_API_MEMBER module( const std::byte * beg, const std::byte * end, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
508 LIBOPENMPT_CXX_API_MEMBER module( const std::byte * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
517 LIBOPENMPT_CXX_API_MEMBER module( const std::vector<std::uint8_t> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
527 LIBOPENMPT_CXX_API_MEMBER module( const std::uint8_t * beg, const std::uint8_t * end, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
537 LIBOPENMPT_CXX_API_MEMBER module( const std::uint8_t * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
546 LIBOPENMPT_CXX_API_MEMBER module( const std::vector<char> & data, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
556 LIBOPENMPT_CXX_API_MEMBER module( const char * beg, const char * end, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
566 LIBOPENMPT_CXX_API_MEMBER module( const char * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
576 LIBOPENMPT_CXX_API_MEMBER module( const void * data, std::size_t size, std::ostream & log = std::clog, const std::map< std::string, std::string > & ctls = detail::initial_ctls_map() );
577 LIBOPENMPT_CXX_API_MEMBER virtual ~module();
578public:
579
581
587 LIBOPENMPT_CXX_API_MEMBER void select_subsong( std::int32_t subsong );
589
594 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_selected_subsong() const;
595
597
604 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_restart_order( std::int32_t subsong ) const;
606
613 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_restart_row( std::int32_t subsong ) const;
614
616
623 LIBOPENMPT_CXX_API_MEMBER void set_repeat_count( std::int32_t repeat_count );
625
632 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_repeat_count() const;
633
635
639 LIBOPENMPT_CXX_API_MEMBER double get_duration_seconds() const;
640
642
649 LIBOPENMPT_CXX_API_MEMBER double get_time_at_position( std::int32_t order, std::int32_t row ) const;
650
652
657 LIBOPENMPT_CXX_API_MEMBER double set_position_seconds( double seconds );
659
663 LIBOPENMPT_CXX_API_MEMBER double get_position_seconds() const;
664
666
674 LIBOPENMPT_CXX_API_MEMBER double set_position_order_row( std::int32_t order, std::int32_t row );
675
677
684 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_render_param( int param ) const;
686
693 LIBOPENMPT_CXX_API_MEMBER void set_render_param( int param, std::int32_t value );
694
697
708 LIBOPENMPT_CXX_API_MEMBER std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * mono );
710
722 LIBOPENMPT_CXX_API_MEMBER std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right );
724
738 LIBOPENMPT_CXX_API_MEMBER std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right, std::int16_t * rear_left, std::int16_t * rear_right );
740
751 LIBOPENMPT_CXX_API_MEMBER std::size_t read( std::int32_t samplerate, std::size_t count, float * mono );
753
765 LIBOPENMPT_CXX_API_MEMBER std::size_t read( std::int32_t samplerate, std::size_t count, float * left, float * right );
767
781 LIBOPENMPT_CXX_API_MEMBER std::size_t read( std::int32_t samplerate, std::size_t count, float * left, float * right, float * rear_left, float * rear_right );
783
794 LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_stereo );
796
807 LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, std::int16_t * interleaved_quad );
809
820 LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_stereo( std::int32_t samplerate, std::size_t count, float * interleaved_stereo );
822
833 LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_quad( std::int32_t samplerate, std::size_t count, float * interleaved_quad );
837
841 LIBOPENMPT_CXX_API_MEMBER std::vector<std::string> get_metadata_keys() const;
843
862 LIBOPENMPT_CXX_API_MEMBER std::string get_metadata( const std::string & key ) const;
863
865
870 LIBOPENMPT_CXX_API_MEMBER double get_current_estimated_bpm() const;
872
875 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_speed() const;
877
881 LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_tempo() const;
883
887 LIBOPENMPT_CXX_API_MEMBER double get_current_tempo2() const;
889
892 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_order() const;
894
897 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_pattern() const;
899
902 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_row() const;
904
907 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_playing_channels() const;
908
910
915 LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_mono( std::int32_t channel ) const;
917
922 LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_left( std::int32_t channel ) const;
924
929 LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_right( std::int32_t channel ) const;
931
936 LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_rear_left( std::int32_t channel ) const;
938
943 LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_rear_right( std::int32_t channel ) const;
944
946
950 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_subsongs() const;
952
956 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_channels() const;
958
961 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_orders() const;
963
966 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_patterns() const;
968
971 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_instruments() const;
973
976 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_samples() const;
977
979
983 LIBOPENMPT_CXX_API_MEMBER std::vector<std::string> get_subsong_names() const;
985
989 LIBOPENMPT_CXX_API_MEMBER std::vector<std::string> get_channel_names() const;
991
995 LIBOPENMPT_CXX_API_MEMBER std::vector<std::string> get_order_names() const;
997
1001 LIBOPENMPT_CXX_API_MEMBER std::vector<std::string> get_pattern_names() const;
1003
1007 LIBOPENMPT_CXX_API_MEMBER std::vector<std::string> get_instrument_names() const;
1009
1013 LIBOPENMPT_CXX_API_MEMBER std::vector<std::string> get_sample_names() const;
1014
1016
1020 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_order_pattern( std::int32_t order ) const;
1021
1023
1029 LIBOPENMPT_CXX_API_MEMBER bool is_order_skip_entry( std::int32_t order ) const ;
1031
1037 LIBOPENMPT_CXX_API_MEMBER bool is_pattern_skip_item( std::int32_t pattern ) const;
1039
1045 LIBOPENMPT_CXX_API_MEMBER bool is_order_stop_entry( std::int32_t order ) const;
1047
1053 LIBOPENMPT_CXX_API_MEMBER bool is_pattern_stop_item( std::int32_t pattern ) const;
1054
1056
1060 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_num_rows( std::int32_t pattern ) const;
1061
1063
1069 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_rows_per_beat( std::int32_t pattern ) const;
1070
1072
1078 LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_rows_per_measure( std::int32_t pattern ) const;
1079
1081
1088 LIBOPENMPT_CXX_API_MEMBER std::uint8_t get_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel, int command ) const;
1089
1091
1099 LIBOPENMPT_CXX_API_MEMBER std::string format_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel, int command ) const;
1100
1102
1121 LIBOPENMPT_CXX_API_MEMBER std::string highlight_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel, int command ) const;
1122
1124
1133 LIBOPENMPT_CXX_API_MEMBER std::string format_pattern_row_channel( std::int32_t pattern, std::int32_t row, std::int32_t channel, std::size_t width = 0, bool pad = true ) const;
1135
1144 LIBOPENMPT_CXX_API_MEMBER std::string highlight_pattern_row_channel( std::int32_t pattern, std::int32_t row, std::int32_t channel, std::size_t width = 0, bool pad = true ) const;
1145
1147
1177 LIBOPENMPT_CXX_API_MEMBER std::vector<std::string> get_ctls() const;
1178
1180
1186 LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER std::string ctl_get( const std::string & ctl ) const;
1188
1194 LIBOPENMPT_CXX_API_MEMBER bool ctl_get_boolean( std::string_view ctl ) const;
1196
1202 LIBOPENMPT_CXX_API_MEMBER std::int64_t ctl_get_integer( std::string_view ctl ) const;
1204
1210 LIBOPENMPT_CXX_API_MEMBER double ctl_get_floatingpoint( std::string_view ctl ) const;
1212
1218 LIBOPENMPT_CXX_API_MEMBER std::string ctl_get_text( std::string_view ctl ) const;
1219
1221
1228 LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER void ctl_set( const std::string & ctl, const std::string & value );
1230
1237 LIBOPENMPT_CXX_API_MEMBER void ctl_set_boolean( std::string_view ctl, bool value );
1239
1246 LIBOPENMPT_CXX_API_MEMBER void ctl_set_integer( std::string_view ctl, std::int64_t value );
1248
1255 LIBOPENMPT_CXX_API_MEMBER void ctl_set_floatingpoint( std::string_view ctl, double value );
1257
1264 LIBOPENMPT_CXX_API_MEMBER void ctl_set_text( std::string_view ctl, std::string_view value );
1265
1266 // remember to add new functions to both C and C++ interfaces and to increase OPENMPT_API_VERSION_MINOR
1267
1268}; // class module
1269
1274} // namespace openmpt
1275
1276#endif // LIBOPENMPT_HPP
openmpt::exception
libopenmpt exception base class
Definition: libopenmpt.hpp:145
openmpt::exception::exception
LIBOPENMPT_CXX_API_MEMBER exception(const exception &other) noexcept
openmpt::exception::~exception
virtual LIBOPENMPT_CXX_API_MEMBER ~exception() noexcept
openmpt::exception::exception
LIBOPENMPT_CXX_API_MEMBER exception(exception &&other) noexcept
openmpt::exception::exception
LIBOPENMPT_CXX_API_MEMBER exception(const std::string &text) noexcept
openmpt::module_ext
Definition: libopenmpt_ext.hpp:37
openmpt::module
Definition: libopenmpt.hpp:400
openmpt::module::get_pattern_rows_per_beat
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_rows_per_beat(std::int32_t pattern) const
Get the rows per beat of a pattern.
openmpt::module::get_order_names
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_order_names() const
Get a list of order names.
openmpt::module::get_current_channel_vu_left
LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_left(std::int32_t channel) const
Get an approximate indication of the channel volume on the front-left speaker.
openmpt::module::read_interleaved_stereo
LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_stereo(std::int32_t samplerate, std::size_t count, float *interleaved_stereo)
Render audio data.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const std::vector< std::uint8_t > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::get_current_channel_vu_right
LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_right(std::int32_t channel) const
Get an approximate indication of the channel volume on the front-right speaker.
openmpt::module::~module
virtual LIBOPENMPT_CXX_API_MEMBER ~module()
openmpt::module::get_sample_names
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_sample_names() const
Get a list of sample names.
openmpt::module::get_current_pattern
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_pattern() const
Get the current pattern.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const std::byte *beg, const std::byte *end, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::ctl_get
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER std::string ctl_get(const std::string &ctl) const
Get current ctl value.
openmpt::module::set_repeat_count
LIBOPENMPT_CXX_API_MEMBER void set_repeat_count(std::int32_t repeat_count)
Set Repeat Count.
openmpt::module::is_pattern_stop_item
LIBOPENMPT_CXX_API_MEMBER bool is_pattern_stop_item(std::int32_t pattern) const
Check if specified pattern index is a stop ("---") item.
openmpt::module::get_current_channel_vu_mono
LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_mono(std::int32_t channel) const
Get an approximate indication of the channel volume.
openmpt::module::get_time_at_position
LIBOPENMPT_CXX_API_MEMBER double get_time_at_position(std::int32_t order, std::int32_t row) const
Get approximate playback time in seconds at given position.
openmpt::module::set_position_seconds
LIBOPENMPT_CXX_API_MEMBER double set_position_seconds(double seconds)
Set approximate current song position.
openmpt::module::get_position_seconds
LIBOPENMPT_CXX_API_MEMBER double get_position_seconds() const
Get current song position.
openmpt::module::select_subsong
LIBOPENMPT_CXX_API_MEMBER void select_subsong(std::int32_t subsong)
Select a sub-song from a multi-song module.
openmpt::module::set_render_param
LIBOPENMPT_CXX_API_MEMBER void set_render_param(int param, std::int32_t value)
Set render parameter.
openmpt::module::read_interleaved_quad
LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_quad(std::int32_t samplerate, std::size_t count, float *interleaved_quad)
Render audio data.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const char *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::set_position_order_row
LIBOPENMPT_CXX_API_MEMBER double set_position_order_row(std::int32_t order, std::int32_t row)
Set approximate current song position.
openmpt::module::get_instrument_names
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_instrument_names() const
Get a list of instrument names.
openmpt::module::get_ctls
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_ctls() const
Retrieve supported ctl keys.
openmpt::module::get_num_patterns
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_patterns() const
Get the number of patterns.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const void *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(std::istream &stream, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
Construct an openmpt::module.
openmpt::module::ctl_set_boolean
LIBOPENMPT_CXX_API_MEMBER void ctl_set_boolean(std::string_view ctl, bool value)
Set ctl boolean value.
openmpt::module::is_order_skip_entry
LIBOPENMPT_CXX_API_MEMBER bool is_order_skip_entry(std::int32_t order) const
Check if specified order is a skip ("+++") item.
openmpt::module::get_selected_subsong
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_selected_subsong() const
Get currently selected sub-song from a multi-song module.
openmpt::module::get_current_tempo
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_tempo() const
Get the current tempo.
openmpt::module::read
LIBOPENMPT_CXX_API_MEMBER std::size_t read(std::int32_t samplerate, std::size_t count, float *left, float *right)
Render audio data.
openmpt::module::read
LIBOPENMPT_CXX_API_MEMBER std::size_t read(std::int32_t samplerate, std::size_t count, std::int16_t *mono)
Render audio data.
openmpt::module::get_current_channel_vu_rear_right
LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_rear_right(std::int32_t channel) const
Get an approximate indication of the channel volume on the rear-right speaker.
openmpt::module::get_pattern_num_rows
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_num_rows(std::int32_t pattern) const
Get the number of rows in a pattern.
openmpt::module::ctl_set_integer
LIBOPENMPT_CXX_API_MEMBER void ctl_set_integer(std::string_view ctl, std::int64_t value)
Set ctl integer value.
openmpt::module::read_interleaved_stereo
LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_stereo(std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_stereo)
Render audio data.
openmpt::module::ctl_get_integer
LIBOPENMPT_CXX_API_MEMBER std::int64_t ctl_get_integer(std::string_view ctl) const
Get current ctl integer value.
openmpt::module::get_current_playing_channels
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_playing_channels() const
Get the current amount of playing channels.
openmpt::module::get_metadata
LIBOPENMPT_CXX_API_MEMBER std::string get_metadata(const std::string &key) const
Get a metadata item value.
openmpt::module::format_pattern_row_channel_command
LIBOPENMPT_CXX_API_MEMBER std::string format_pattern_row_channel_command(std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
Get formatted (human-readable) pattern content.
openmpt::module::get_pattern_names
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_pattern_names() const
Get a list of pattern names.
openmpt::module::get_subsong_names
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_subsong_names() const
Get a list of sub-song names.
openmpt::module::get_duration_seconds
LIBOPENMPT_CXX_API_MEMBER double get_duration_seconds() const
Get approximate song duration.
openmpt::module::get_current_speed
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_speed() const
Get the current speed.
openmpt::module::get_order_pattern
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_order_pattern(std::int32_t order) const
Get pattern at order position.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const char *beg, const char *end, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::get_restart_order
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_restart_order(std::int32_t subsong) const
Get the restart order of the specified sub-song.
openmpt::module::get_render_param
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_render_param(int param) const
Get render parameter.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const std::uint8_t *beg, const std::uint8_t *end, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::get_channel_names
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_channel_names() const
Get a list of channel names.
openmpt::module::get_current_channel_vu_rear_left
LIBOPENMPT_CXX_API_MEMBER float get_current_channel_vu_rear_left(std::int32_t channel) const
Get an approximate indication of the channel volume on the rear-left speaker.
openmpt::module::ctl_set_floatingpoint
LIBOPENMPT_CXX_API_MEMBER void ctl_set_floatingpoint(std::string_view ctl, double value)
Set ctl floatingpoint value.
openmpt::module::get_current_tempo2
LIBOPENMPT_CXX_API_MEMBER double get_current_tempo2() const
Get the current tempo.
openmpt::module::read
LIBOPENMPT_CXX_API_MEMBER std::size_t read(std::int32_t samplerate, std::size_t count, float *left, float *right, float *rear_left, float *rear_right)
Render audio data.
openmpt::module::get_metadata_keys
LIBOPENMPT_CXX_API_MEMBER std::vector< std::string > get_metadata_keys() const
Get the list of supported metadata item keys.
openmpt::module::get_current_estimated_bpm
LIBOPENMPT_CXX_API_MEMBER double get_current_estimated_bpm() const
Get the current estimated beats per minute (BPM).
openmpt::module::highlight_pattern_row_channel_command
LIBOPENMPT_CXX_API_MEMBER std::string highlight_pattern_row_channel_command(std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
Get highlighting information for formatted pattern content.
openmpt::module::get_pattern_rows_per_measure
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_rows_per_measure(std::int32_t pattern) const
Get the rows per measure of a pattern.
openmpt::module::read_interleaved_quad
LIBOPENMPT_CXX_API_MEMBER std::size_t read_interleaved_quad(std::int32_t samplerate, std::size_t count, std::int16_t *interleaved_quad)
Render audio data.
openmpt::module::get_current_order
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_order() const
Get the current order.
openmpt::module::get_restart_row
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_restart_row(std::int32_t subsong) const
Get the restart row of the specified sub-song.
openmpt::module::get_repeat_count
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_repeat_count() const
Get Repeat Count.
openmpt::module::ctl_get_text
LIBOPENMPT_CXX_API_MEMBER std::string ctl_get_text(std::string_view ctl) const
Get current ctl text value.
openmpt::module::render_param
render_param
Parameter index to use with openmpt::module::get_render_param and openmpt::module::set_render_param.
Definition: libopenmpt.hpp:407
openmpt::module::get_num_instruments
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_instruments() const
Get the number of instruments.
openmpt::module::ctl_get_boolean
LIBOPENMPT_CXX_API_MEMBER bool ctl_get_boolean(std::string_view ctl) const
Get current ctl boolean value.
openmpt::module::get_pattern_row_channel_command
LIBOPENMPT_CXX_API_MEMBER std::uint8_t get_pattern_row_channel_command(std::int32_t pattern, std::int32_t row, std::int32_t channel, int command) const
Get raw pattern content.
openmpt::module::ctl_get_floatingpoint
LIBOPENMPT_CXX_API_MEMBER double ctl_get_floatingpoint(std::string_view ctl) const
Get current ctl floatingpoint value.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const std::byte *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::ctl_set
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API_MEMBER void ctl_set(const std::string &ctl, const std::string &value)
Set ctl value.
openmpt::module::highlight_pattern_row_channel
LIBOPENMPT_CXX_API_MEMBER std::string highlight_pattern_row_channel(std::int32_t pattern, std::int32_t row, std::int32_t channel, std::size_t width=0, bool pad=true) const
Get highlighting information for formatted pattern content.
openmpt::module::command_index
command_index
Parameter index to use with openmpt::module::get_pattern_row_channel_command, openmpt::module::format...
Definition: libopenmpt.hpp:447
openmpt::module::read
LIBOPENMPT_CXX_API_MEMBER std::size_t read(std::int32_t samplerate, std::size_t count, float *mono)
Render audio data.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const std::vector< std::byte > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::read
LIBOPENMPT_CXX_API_MEMBER std::size_t read(std::int32_t samplerate, std::size_t count, std::int16_t *left, std::int16_t *right, std::int16_t *rear_left, std::int16_t *rear_right)
Render audio data.
openmpt::module::get_num_samples
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_samples() const
Get the number of samples.
openmpt::module::ctl_set_text
LIBOPENMPT_CXX_API_MEMBER void ctl_set_text(std::string_view ctl, std::string_view value)
Set ctl text value.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const std::vector< char > &data, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::is_order_stop_entry
LIBOPENMPT_CXX_API_MEMBER bool is_order_stop_entry(std::int32_t order) const
Check if specified order is a stop ("---") item.
openmpt::module::get_num_subsongs
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_subsongs() const
Get the number of sub-songs.
openmpt::module::module
LIBOPENMPT_CXX_API_MEMBER module(const std::uint8_t *data, std::size_t size, std::ostream &log=std::clog, const std::map< std::string, std::string > &ctls=detail::initial_ctls_map())
openmpt::module::get_current_row
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_current_row() const
Get the current row.
openmpt::module::get_num_channels
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_channels() const
Get the number of pattern channels.
openmpt::module::read
LIBOPENMPT_CXX_API_MEMBER std::size_t read(std::int32_t samplerate, std::size_t count, std::int16_t *left, std::int16_t *right)
Render audio data.
openmpt::module::format_pattern_row_channel
LIBOPENMPT_CXX_API_MEMBER std::string format_pattern_row_channel(std::int32_t pattern, std::int32_t row, std::int32_t channel, std::size_t width=0, bool pad=true) const
Get formatted (human-readable) pattern content.
openmpt::module::is_pattern_skip_item
LIBOPENMPT_CXX_API_MEMBER bool is_pattern_skip_item(std::int32_t pattern) const
Check if specified pattern index is a skip ("+++") item.
openmpt::module::get_num_orders
LIBOPENMPT_CXX_API_MEMBER std::int32_t get_num_orders() const
Get the number of orders.
openmpt::probe_file_header_flags
probe_file_header_flags
Possible values for openmpt::probe_file_header() flags parameter.
Definition: libopenmpt.hpp:288
openmpt::get_supported_extensions
LIBOPENMPT_CXX_API std::vector< std::string > get_supported_extensions()
Get a list of supported file extensions.
openmpt::is_extension_supported2
LIBOPENMPT_CXX_API bool is_extension_supported2(std::string_view extension)
Query whether a file extension is supported.
openmpt::probe_file_header_result
probe_file_header_result
Possible return values for openmpt::probe_file_header().
Definition: libopenmpt.hpp:300
openmpt::is_extension_supported
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API bool is_extension_supported(const std::string &extension)
Query whether a file extension is supported.
openmpt::LIBOPENMPT_ATTR_DEPRECATED
static const std::uint64_t probe_file_header_flags_modules LIBOPENMPT_ATTR_DEPRECATED
Probe for module formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:276
openmpt::could_open_probability
LIBOPENMPT_CXX_API double could_open_probability(std::istream &stream, double effort=1.0, std::ostream &log=std::clog)
Roughly scan the input stream to find out whether libopenmpt might be able to open it.
openmpt::could_open_propability
LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API double could_open_propability(std::istream &stream, double effort=1.0, std::ostream &log=std::clog)
Roughly scan the input stream to find out whether libopenmpt might be able to open it.
openmpt::get_core_version
LIBOPENMPT_CXX_API std::uint32_t get_core_version()
Get the core version number.
openmpt::probe_file_header
LIBOPENMPT_CXX_API int probe_file_header(std::uint64_t flags, const std::byte *data, std::size_t size, std::uint64_t filesize)
Probe the provided bytes from the beginning of a file for supported file format headers to find out w...
openmpt::get_library_version
LIBOPENMPT_CXX_API std::uint32_t get_library_version()
Get the libopenmpt version number.
openmpt::probe_file_header_get_recommended_size
LIBOPENMPT_CXX_API std::size_t probe_file_header_get_recommended_size()
Get recommended header size for successfull format probing.
openmpt::probe_file_header_flags_none2
@ probe_file_header_flags_none2
Probe for no formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:296
openmpt::probe_file_header_flags_default2
@ probe_file_header_flags_default2
Probe for the default set of formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:294
openmpt::probe_file_header_flags_containers2
@ probe_file_header_flags_containers2
Probe for module-specific container formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:292
openmpt::probe_file_header_flags_modules2
@ probe_file_header_flags_modules2
Probe for module formats in openmpt::probe_file_header().
Definition: libopenmpt.hpp:290
openmpt::probe_file_header_result_success
@ probe_file_header_result_success
The file will most likely be supported by libopenmpt.
Definition: libopenmpt.hpp:302
openmpt::probe_file_header_result_failure
@ probe_file_header_result_failure
The file is not supported by libopenmpt.
Definition: libopenmpt.hpp:304
openmpt::probe_file_header_result_wantmoredata
@ probe_file_header_result_wantmoredata
An answer could not be determined with the amount of data provided.
Definition: libopenmpt.hpp:306
libopenmpt_config.h
openmpt::string::get
LIBOPENMPT_CXX_API std::string get(const std::string &key)
Get library related metadata.
openmpt
Definition: libopenmpt.hpp:130