From: <man...@us...> - 2013-05-11 14:51:23
|
Revision: 2014 http://sourceforge.net/p/modplug/code/2014 Author: manxorist Date: 2013-05-11 14:51:10 +0000 (Sat, 11 May 2013) Log Message: ----------- [New] Add a (soon) portable libopenmpt player library with a stable C and C++ API and ABI. This has (of course) no VST support. Archive support is also disabled as this is probably handled better by the library user. [New] Add a simple C and a simple C++ example player which demonstrates basic usage of libopenmpt. [New] Add libmodplug emulation layer via libopenmpt. [New] Add a skeleton libopenmpt_interactive interface with a probably less stable API and ABI as libopenmpt which can be extended with all kinds of functionality that is not just module playback. [New] Add in_openmpt, a winamp2 compatible input plugin. [New] Add xmp-openmpt, a xmplay compatible file format plugin. [New] Add libopenmpt_settings, a settings window for player plugins (requires installed .net 4.0 framework). It can be disbaled by the user by just deleting the DLL. The winamp and xmplay plugin will continue to work without a settings window then. Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/include/readme.txt Added Paths: ----------- trunk/OpenMPT/include/libmodplug/ trunk/OpenMPT/include/winamp/ trunk/OpenMPT/include/xmplay/ trunk/OpenMPT/libopenmpt/ trunk/OpenMPT/libopenmpt/SettingsForm.cpp trunk/OpenMPT/libopenmpt/SettingsForm.h trunk/OpenMPT/libopenmpt/SettingsForm.resx trunk/OpenMPT/libopenmpt/bin/ trunk/OpenMPT/libopenmpt/examples/ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp trunk/OpenMPT/libopenmpt/libopenmpt.cpp trunk/OpenMPT/libopenmpt/libopenmpt.h trunk/OpenMPT/libopenmpt/libopenmpt.hpp trunk/OpenMPT/libopenmpt/libopenmpt.sln trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj trunk/OpenMPT/libopenmpt/libopenmpt.vcxproj.filters trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp trunk/OpenMPT/libopenmpt/libopenmpt_config.h trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp trunk/OpenMPT/libopenmpt/libopenmpt_interactive.cpp trunk/OpenMPT/libopenmpt/libopenmpt_interactive.hpp trunk/OpenMPT/libopenmpt/libopenmpt_internal.h trunk/OpenMPT/libopenmpt/libopenmpt_modplug.c trunk/OpenMPT/libopenmpt/libopenmpt_settings.cpp trunk/OpenMPT/libopenmpt/libopenmpt_settings.h trunk/OpenMPT/libopenmpt/libopenmpt_settings.vcxproj trunk/OpenMPT/libopenmpt/libopenmpt_settings.vcxproj.filters trunk/OpenMPT/libopenmpt/libopenmpt_settings_dialog.cpp trunk/OpenMPT/libopenmpt/libopenmpt_settings_dialog.h trunk/OpenMPT/libopenmpt/libopenmpt_stream_callbacks.h trunk/OpenMPT/libopenmpt/libopenmpt_version.cpp trunk/OpenMPT/libopenmpt/libopenmpt_version.h trunk/OpenMPT/libopenmpt/libopenmpt_winamp.cpp trunk/OpenMPT/libopenmpt/libopenmpt_xmplay.cpp trunk/OpenMPT/libopenmpt/libopenmpt_xmplay_c.c trunk/OpenMPT/libopenmpt/xmpin.def Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/common/BuildSettings.h 2013-05-11 14:51:10 UTC (rev 2014) @@ -41,6 +41,17 @@ #endif // ENABLE_ASM + + +#if defined(MODPLUG_TRACKER) && defined(LIBOPENMPT_BUILD) + +#error "either MODPLUG_TRACKER or LIBOPENMPT_BUILD has to be defined" + +#elif defined(MODPLUG_TRACKER) + +// Disable any file saving functionality (not really useful except for the player library) +//#define MODPLUG_NO_FILESAVE + // Disable any debug logging //#define NO_LOGGING @@ -83,8 +94,54 @@ // Define to build without MP3 import support (via mpg123) //#define NO_MP3_SAMPLES +// Do not build libmodplug emulation layer (only makes sense for library) +#define NO_LIBMODPLUG +// Do not build xmplay input plugin cod (only makes snse for library) +#define NO_XMPLAY +// Do not build winamp input plugin code (only makes sense for library) +#define NO_WINAMP + +// Do not build libopenmpt C api +#define NO_LIBOPENMPT_C + +// Do not build libopenmpt C++ api +#define NO_LIBOPENMPT_CXX + +#elif defined(LIBOPENMPT_BUILD) + +#define MODPLUG_NO_FILESAVE +//#define NO_LOGGING +#define NO_ARCHIVE_SUPPORT +//#define NO_FILEREADER_STD_ISTREAM +#define NO_REVERB +#define NO_DSP +#define NO_EQ +#define NO_AGC +#define NO_ASIO +#define NO_VST +#define NO_PORTAUDIO +#if !defined(_WIN32) +#define NO_MO3 +#endif +#define NO_DSOUND +#define NO_FLAC +#define NO_MP3_SAMPLES +//#define NO_LIBMODPLUG +//#define NO_WINAMP +//#define NO_XMPLAY +//#define NO_LIBOPENMPT_C +//#define NO_LIBOPENMPT_CXX + +#else + +#error "either MODPLUG_TRACKER or LIBOPENMPT_BUILD has to be defined" + +#endif + + + #ifdef _MSC_VER #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #endif Index: trunk/OpenMPT/include/libmodplug =================================================================== --- trunk/OpenMPT/include/libmodplug 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/include/libmodplug 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/include/libmodplug ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Modified: trunk/OpenMPT/include/readme.txt =================================================================== --- trunk/OpenMPT/include/readme.txt 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/include/readme.txt 2013-05-11 14:51:10 UTC (rev 2014) @@ -29,4 +29,22 @@ library should be easy. Please visit https://sourceforge.net/projects/portmedia/files/portmidi/ -to download the SDK. \ No newline at end of file +to download the SDK. + +LibModplug +=========== +To build libopenmpt with a libmodplug compatible interface, copy the libmodplug +header files from xmms-modplug into libmodplug directory. +Use #define NO_LIBMODPLUG in common/BuildSettings.h to disable. + +Winamp2 SDK +=========== +To build libopenmpt as a winamp2 input plugin, copy the winamp2 SDK headers to +include/winamp/. +Use #define NO_WINAMP in common/BuildSettings.h to disable. + +xmplay input SDK +================ +To build libopenmpt with xmplay input plugin support, copy the contents of +xmpin.zip into include/xmplay/. +Use #define NO_XMPLAY in common/BuildSettings.h to disable. Index: trunk/OpenMPT/include/winamp =================================================================== --- trunk/OpenMPT/include/winamp 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/include/winamp 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/include/winamp ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Index: trunk/OpenMPT/include/xmplay =================================================================== --- trunk/OpenMPT/include/xmplay 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/include/xmplay 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/include/xmplay ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Index: trunk/OpenMPT/libopenmpt =================================================================== --- trunk/OpenMPT/libopenmpt 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/libopenmpt 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/libopenmpt ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,16 ## +Debug +DebugStatic +Release +ReleaseStatic +ipch +libopenmpt.opensdf +libopenmpt.sdf +libopenmpt.suo +libopenmpt.vcxproj.user +libopenmpt_foobar2000.sdf +libopenmpt_foobar2000.vcxproj.user +libopenmpt_settings-Debug +libopenmpt_settings-Release +libopenmpt_settings.vcxproj.user +libopenmpt_foobar2000.opensdf +libopenmpt_foobar2000.suo Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/SettingsForm.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/SettingsForm.cpp (rev 0) +++ trunk/OpenMPT/libopenmpt/SettingsForm.cpp 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,4 @@ + +#define LIBOPENMPT_BUILD_SETTINGS_DLL +#include "SettingsForm.h" + Property changes on: trunk/OpenMPT/libopenmpt/SettingsForm.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/SettingsForm.h =================================================================== --- trunk/OpenMPT/libopenmpt/SettingsForm.h (rev 0) +++ trunk/OpenMPT/libopenmpt/SettingsForm.h 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,430 @@ +#pragma once + +#include "libopenmpt_settings.h" + +namespace libopenmpt { + + using namespace System; + using namespace System::ComponentModel; + using namespace System::Collections; + using namespace System::Windows::Forms; + using namespace System::Data; + using namespace System::Drawing; + + /// <summary> + /// Summary for SettingsForm + /// </summary> + public ref class SettingsForm : public System::Windows::Forms::Form + { + private: + openmpt::settings * settings; + public: + SettingsForm( const char * title, openmpt::settings * s ) : settings(s) + { + InitializeComponent(); + + Text = gcnew System::String( title ); + + comboBoxSamplerate->Items->Add(6000); + comboBoxSamplerate->Items->Add(8000); + comboBoxSamplerate->Items->Add(11025); + comboBoxSamplerate->Items->Add(16000); + comboBoxSamplerate->Items->Add(22050); + comboBoxSamplerate->Items->Add(32000); + comboBoxSamplerate->Items->Add(44100); + comboBoxSamplerate->Items->Add(48000); + comboBoxSamplerate->Items->Add(88200); + comboBoxSamplerate->Items->Add(96000); + comboBoxSamplerate->SelectedItem = settings->samplerate; + + comboBoxChannels->Items->Add("mono"); + comboBoxChannels->Items->Add("stereo"); + comboBoxChannels->Items->Add("quad"); + if ( settings->channels == 1 ) comboBoxChannels->SelectedItem = "mono"; + if ( settings->channels == 2 ) comboBoxChannels->SelectedItem = "stereo"; + if ( settings->channels == 3 ) comboBoxChannels->SelectedItem = "quad"; + + comboBoxSamplerate->Enabled = settings->with_outputformat; + comboBoxChannels->Enabled = settings->with_outputformat; + + trackBarGain->Value = settings->mastergain; + + trackBarMaxPolyphony->Value = settings->maxmixchannels; + + comboBoxInterpolation->SelectedIndex = settings->interpolationmode - 1; + + comboBoxRepeat->SelectedIndex = settings->repeatcount + 1; + + trackBarStereoSeparation->Value = settings->stereoseparation; + + trackBarVolrampin->Value = settings->volrampin; + trackBarVolrampout->Value = settings->volrampout; + + // + //TODO: Add the constructor code here + // + } + + protected: + /// <summary> + /// Clean up any resources being used. + /// </summary> + ~SettingsForm() + { + if (components) + { + delete components; + } + } + private: System::Windows::Forms::ComboBox^ comboBoxSamplerate; + protected: + private: System::Windows::Forms::Label^ labelSamplerate; + private: System::Windows::Forms::Button^ buttonOK; + private: System::Windows::Forms::Label^ labelChannels; + private: System::Windows::Forms::ComboBox^ comboBoxChannels; + private: System::Windows::Forms::Label^ labelGain; + private: System::Windows::Forms::TrackBar^ trackBarGain; + private: System::Windows::Forms::Label^ labelMaxPolyphony; + private: System::Windows::Forms::TrackBar^ trackBarMaxPolyphony; + private: System::Windows::Forms::Label^ labelInterpolation; + private: System::Windows::Forms::ComboBox^ comboBoxInterpolation; + private: System::Windows::Forms::Label^ labelRepeat; + private: System::Windows::Forms::ComboBox^ comboBoxRepeat; + private: System::Windows::Forms::Label^ labelStereoSeparation; + private: System::Windows::Forms::TrackBar^ trackBarStereoSeparation; + private: System::Windows::Forms::Label^ labelVolrampin; + private: System::Windows::Forms::Label^ labelVolrampout; + private: System::Windows::Forms::TrackBar^ trackBarVolrampin; + private: System::Windows::Forms::TrackBar^ trackBarVolrampout; + + + protected: + + private: + /// <summary> + /// Required designer variable. + /// </summary> + System::ComponentModel::Container ^components; + +#pragma region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + void InitializeComponent(void) + { + this->comboBoxSamplerate = (gcnew System::Windows::Forms::ComboBox()); + this->labelSamplerate = (gcnew System::Windows::Forms::Label()); + this->buttonOK = (gcnew System::Windows::Forms::Button()); + this->labelChannels = (gcnew System::Windows::Forms::Label()); + this->comboBoxChannels = (gcnew System::Windows::Forms::ComboBox()); + this->labelGain = (gcnew System::Windows::Forms::Label()); + this->trackBarGain = (gcnew System::Windows::Forms::TrackBar()); + this->labelMaxPolyphony = (gcnew System::Windows::Forms::Label()); + this->trackBarMaxPolyphony = (gcnew System::Windows::Forms::TrackBar()); + this->labelInterpolation = (gcnew System::Windows::Forms::Label()); + this->comboBoxInterpolation = (gcnew System::Windows::Forms::ComboBox()); + this->labelRepeat = (gcnew System::Windows::Forms::Label()); + this->comboBoxRepeat = (gcnew System::Windows::Forms::ComboBox()); + this->labelStereoSeparation = (gcnew System::Windows::Forms::Label()); + this->trackBarStereoSeparation = (gcnew System::Windows::Forms::TrackBar()); + this->labelVolrampin = (gcnew System::Windows::Forms::Label()); + this->labelVolrampout = (gcnew System::Windows::Forms::Label()); + this->trackBarVolrampin = (gcnew System::Windows::Forms::TrackBar()); + this->trackBarVolrampout = (gcnew System::Windows::Forms::TrackBar()); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarGain))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarMaxPolyphony))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarStereoSeparation))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampin))->BeginInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampout))->BeginInit(); + this->SuspendLayout(); + // + // comboBoxSamplerate + // + this->comboBoxSamplerate->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList; + this->comboBoxSamplerate->FormattingEnabled = true; + this->comboBoxSamplerate->Location = System::Drawing::Point(106, 9); + this->comboBoxSamplerate->Name = L"comboBoxSamplerate"; + this->comboBoxSamplerate->Size = System::Drawing::Size(121, 21); + this->comboBoxSamplerate->TabIndex = 1; + this->comboBoxSamplerate->SelectedIndexChanged += gcnew System::EventHandler(this, &SettingsForm::comboBoxSamplerate_SelectedIndexChanged); + // + // labelSamplerate + // + this->labelSamplerate->AutoSize = true; + this->labelSamplerate->Location = System::Drawing::Point(12, 12); + this->labelSamplerate->Name = L"labelSamplerate"; + this->labelSamplerate->Size = System::Drawing::Size(58, 13); + this->labelSamplerate->TabIndex = 0; + this->labelSamplerate->Text = L"samplerate"; + // + // buttonOK + // + this->buttonOK->Location = System::Drawing::Point(15, 357); + this->buttonOK->Name = L"buttonOK"; + this->buttonOK->Size = System::Drawing::Size(212, 23); + this->buttonOK->TabIndex = 2; + this->buttonOK->Text = L"OK"; + this->buttonOK->UseVisualStyleBackColor = true; + this->buttonOK->Click += gcnew System::EventHandler(this, &SettingsForm::buttonOK_Click); + // + // labelChannels + // + this->labelChannels->AutoSize = true; + this->labelChannels->Location = System::Drawing::Point(12, 39); + this->labelChannels->Name = L"labelChannels"; + this->labelChannels->Size = System::Drawing::Size(50, 13); + this->labelChannels->TabIndex = 3; + this->labelChannels->Text = L"channels"; + // + // comboBoxChannels + // + this->comboBoxChannels->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList; + this->comboBoxChannels->FormattingEnabled = true; + this->comboBoxChannels->Location = System::Drawing::Point(106, 36); + this->comboBoxChannels->Name = L"comboBoxChannels"; + this->comboBoxChannels->Size = System::Drawing::Size(121, 21); + this->comboBoxChannels->TabIndex = 4; + // + // labelGain + // + this->labelGain->AutoSize = true; + this->labelGain->Location = System::Drawing::Point(12, 74); + this->labelGain->Name = L"labelGain"; + this->labelGain->Size = System::Drawing::Size(27, 13); + this->labelGain->TabIndex = 5; + this->labelGain->Text = L"gain"; + // + // trackBarGain + // + this->trackBarGain->LargeChange = 3; + this->trackBarGain->Location = System::Drawing::Point(106, 63); + this->trackBarGain->Maximum = 12; + this->trackBarGain->Minimum = -12; + this->trackBarGain->Name = L"trackBarGain"; + this->trackBarGain->Size = System::Drawing::Size(121, 42); + this->trackBarGain->TabIndex = 6; + this->trackBarGain->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarGain->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarGain_Scroll); + // + // labelMaxPolyphony + // + this->labelMaxPolyphony->AutoSize = true; + this->labelMaxPolyphony->Location = System::Drawing::Point(12, 124); + this->labelMaxPolyphony->Name = L"labelMaxPolyphony"; + this->labelMaxPolyphony->Size = System::Drawing::Size(77, 13); + this->labelMaxPolyphony->TabIndex = 7; + this->labelMaxPolyphony->Text = L"max polyphony"; + // + // trackBarMaxPolyphony + // + this->trackBarMaxPolyphony->LargeChange = 16; + this->trackBarMaxPolyphony->Location = System::Drawing::Point(106, 111); + this->trackBarMaxPolyphony->Maximum = 256; + this->trackBarMaxPolyphony->Minimum = 16; + this->trackBarMaxPolyphony->Name = L"trackBarMaxPolyphony"; + this->trackBarMaxPolyphony->Size = System::Drawing::Size(121, 42); + this->trackBarMaxPolyphony->TabIndex = 8; + this->trackBarMaxPolyphony->TickFrequency = 16; + this->trackBarMaxPolyphony->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarMaxPolyphony->Value = 256; + this->trackBarMaxPolyphony->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarMaxPolyphony_Scroll); + // + // labelInterpolation + // + this->labelInterpolation->AutoSize = true; + this->labelInterpolation->Location = System::Drawing::Point(12, 162); + this->labelInterpolation->Name = L"labelInterpolation"; + this->labelInterpolation->Size = System::Drawing::Size(64, 13); + this->labelInterpolation->TabIndex = 9; + this->labelInterpolation->Text = L"interpolation"; + // + // comboBoxInterpolation + // + this->comboBoxInterpolation->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList; + this->comboBoxInterpolation->FormattingEnabled = true; + this->comboBoxInterpolation->Items->AddRange(gcnew cli::array< System::Object^ >(12) {L"nearest", L"linear", L"spline", L"polyphase", + L"fir hann", L"fir hamming", L"fir blackman exact", L"fir blackman 3 tap 1", L"fir blackman 3 tap 2", L"fir blackman 4 tap 1", + L"fir blackman 4 tap 2", L"fir kaiser 4 tap"}); + this->comboBoxInterpolation->Location = System::Drawing::Point(106, 159); + this->comboBoxInterpolation->Name = L"comboBoxInterpolation"; + this->comboBoxInterpolation->Size = System::Drawing::Size(121, 21); + this->comboBoxInterpolation->TabIndex = 10; + this->comboBoxInterpolation->SelectedIndexChanged += gcnew System::EventHandler(this, &SettingsForm::comboBoxInterpolation_SelectedIndexChanged); + // + // labelRepeat + // + this->labelRepeat->AutoSize = true; + this->labelRepeat->Location = System::Drawing::Point(12, 189); + this->labelRepeat->Name = L"labelRepeat"; + this->labelRepeat->Size = System::Drawing::Size(37, 13); + this->labelRepeat->TabIndex = 11; + this->labelRepeat->Text = L"repeat"; + // + // comboBoxRepeat + // + this->comboBoxRepeat->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList; + this->comboBoxRepeat->FormattingEnabled = true; + this->comboBoxRepeat->Items->AddRange(gcnew cli::array< System::Object^ >(3) {L"forever", L"never", L"once"}); + this->comboBoxRepeat->Location = System::Drawing::Point(106, 186); + this->comboBoxRepeat->Name = L"comboBoxRepeat"; + this->comboBoxRepeat->Size = System::Drawing::Size(121, 21); + this->comboBoxRepeat->TabIndex = 12; + this->comboBoxRepeat->SelectedIndexChanged += gcnew System::EventHandler(this, &SettingsForm::comboBoxRepeat_SelectedIndexChanged); + // + // labelStereoSeparation + // + this->labelStereoSeparation->AutoSize = true; + this->labelStereoSeparation->Location = System::Drawing::Point(12, 226); + this->labelStereoSeparation->Name = L"labelStereoSeparation"; + this->labelStereoSeparation->Size = System::Drawing::Size(88, 13); + this->labelStereoSeparation->TabIndex = 13; + this->labelStereoSeparation->Text = L"stereo separation"; + // + // trackBarStereoSeparation + // + this->trackBarStereoSeparation->LargeChange = 100; + this->trackBarStereoSeparation->Location = System::Drawing::Point(106, 213); + this->trackBarStereoSeparation->Maximum = 400; + this->trackBarStereoSeparation->Name = L"trackBarStereoSeparation"; + this->trackBarStereoSeparation->Size = System::Drawing::Size(121, 42); + this->trackBarStereoSeparation->SmallChange = 25; + this->trackBarStereoSeparation->TabIndex = 14; + this->trackBarStereoSeparation->TickFrequency = 100; + this->trackBarStereoSeparation->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarStereoSeparation->Value = 100; + this->trackBarStereoSeparation->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarStereoSeparation_Scroll); + // + // labelVolrampin + // + this->labelVolrampin->AutoSize = true; + this->labelVolrampin->Location = System::Drawing::Point(12, 274); + this->labelVolrampin->Name = L"labelVolrampin"; + this->labelVolrampin->Size = System::Drawing::Size(78, 13); + this->labelVolrampin->TabIndex = 15; + this->labelVolrampin->Text = L"volume ramp in"; + // + // labelVolrampout + // + this->labelVolrampout->AutoSize = true; + this->labelVolrampout->Location = System::Drawing::Point(12, 321); + this->labelVolrampout->Name = L"labelVolrampout"; + this->labelVolrampout->Size = System::Drawing::Size(85, 13); + this->labelVolrampout->TabIndex = 16; + this->labelVolrampout->Text = L"volume ramp out"; + // + // trackBarVolrampin + // + this->trackBarVolrampin->LargeChange = 16; + this->trackBarVolrampin->Location = System::Drawing::Point(106, 261); + this->trackBarVolrampin->Maximum = 256; + this->trackBarVolrampin->Name = L"trackBarVolrampin"; + this->trackBarVolrampin->Size = System::Drawing::Size(121, 42); + this->trackBarVolrampin->TabIndex = 17; + this->trackBarVolrampin->TickFrequency = 16; + this->trackBarVolrampin->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarVolrampin->Value = 16; + this->trackBarVolrampin->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarVolrampin_Scroll); + // + // trackBarVolrampout + // + this->trackBarVolrampout->LargeChange = 16; + this->trackBarVolrampout->Location = System::Drawing::Point(106, 309); + this->trackBarVolrampout->Maximum = 256; + this->trackBarVolrampout->Name = L"trackBarVolrampout"; + this->trackBarVolrampout->Size = System::Drawing::Size(121, 42); + this->trackBarVolrampout->TabIndex = 18; + this->trackBarVolrampout->TickFrequency = 16; + this->trackBarVolrampout->TickStyle = System::Windows::Forms::TickStyle::Both; + this->trackBarVolrampout->Value = 42; + this->trackBarVolrampout->Scroll += gcnew System::EventHandler(this, &SettingsForm::trackBarVolrampout_Scroll); + // + // SettingsForm + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->AutoSize = true; + this->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink; + this->ClientSize = System::Drawing::Size(436, 477); + this->Controls->Add(this->trackBarVolrampout); + this->Controls->Add(this->trackBarVolrampin); + this->Controls->Add(this->labelVolrampout); + this->Controls->Add(this->labelVolrampin); + this->Controls->Add(this->trackBarStereoSeparation); + this->Controls->Add(this->labelStereoSeparation); + this->Controls->Add(this->comboBoxRepeat); + this->Controls->Add(this->labelRepeat); + this->Controls->Add(this->comboBoxInterpolation); + this->Controls->Add(this->labelInterpolation); + this->Controls->Add(this->trackBarMaxPolyphony); + this->Controls->Add(this->labelMaxPolyphony); + this->Controls->Add(this->trackBarGain); + this->Controls->Add(this->labelGain); + this->Controls->Add(this->comboBoxChannels); + this->Controls->Add(this->labelChannels); + this->Controls->Add(this->buttonOK); + this->Controls->Add(this->labelSamplerate); + this->Controls->Add(this->comboBoxSamplerate); + this->MaximizeBox = false; + this->MinimizeBox = false; + this->Name = L"SettingsForm"; + this->ShowIcon = false; + this->ShowInTaskbar = false; + this->SizeGripStyle = System::Windows::Forms::SizeGripStyle::Hide; + this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent; + this->Text = L"SettingsForm"; + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarGain))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarMaxPolyphony))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarStereoSeparation))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampin))->EndInit(); + (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->trackBarVolrampout))->EndInit(); + this->ResumeLayout(false); + this->PerformLayout(); + + } +#pragma endregion + private: System::Void comboBoxSamplerate_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { + settings->samplerate = (int)comboBoxSamplerate->SelectedItem; + settings->changed(); + } + private: System::Void buttonOK_Click(System::Object^ sender, System::EventArgs^ e) { + this->Close(); + settings->changed(); + } +private: System::Void comboBoxChannels_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { + System::String ^ val = (System::String ^)comboBoxChannels->SelectedItem; + if ( val == "mono" ) settings->channels = 1; + if ( val == "stereo" ) settings->channels = 2; + if ( val == "quad" ) settings->channels = 4; + settings->changed(); + } +private: System::Void trackBarGain_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->mastergain = (int)trackBarGain->Value; + settings->changed(); + } +private: System::Void comboBoxInterpolation_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { + settings->interpolationmode = (int)comboBoxInterpolation->SelectedIndex + 1; + settings->changed(); + } +private: System::Void trackBarMaxPolyphony_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->maxmixchannels = (int)trackBarMaxPolyphony->Value; + settings->changed(); + } +private: System::Void comboBoxRepeat_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { + settings->repeatcount = (int)comboBoxRepeat->SelectedIndex - 1; + settings->changed(); + } +private: System::Void trackBarStereoSeparation_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->stereoseparation = (int)trackBarStereoSeparation->Value; + settings->changed(); + } +private: System::Void trackBarVolrampin_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->volrampin = (int)trackBarVolrampin->Value; + settings->changed(); + } +private: System::Void trackBarVolrampout_Scroll(System::Object^ sender, System::EventArgs^ e) { + settings->volrampout = (int)trackBarVolrampout->Value; + settings->changed(); + } +}; +} Property changes on: trunk/OpenMPT/libopenmpt/SettingsForm.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/SettingsForm.resx =================================================================== --- trunk/OpenMPT/libopenmpt/SettingsForm.resx (rev 0) +++ trunk/OpenMPT/libopenmpt/SettingsForm.resx 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Index: trunk/OpenMPT/libopenmpt/bin =================================================================== --- trunk/OpenMPT/libopenmpt/bin 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/libopenmpt/bin 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/libopenmpt/bin ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Index: trunk/OpenMPT/libopenmpt/examples =================================================================== --- trunk/OpenMPT/libopenmpt/examples 2013-05-11 14:41:57 UTC (rev 2013) +++ trunk/OpenMPT/libopenmpt/examples 2013-05-11 14:51:10 UTC (rev 2014) Property changes on: trunk/OpenMPT/libopenmpt/examples ___________________________________________________________________ Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c (rev 0) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,56 @@ +/* + * libopenmpt_example_c.c + * ---------------------- + * Purpose: libopenmpt C API simple example + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include <memory.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <libopenmpt/libopenmpt.h> +#include <libopenmpt/libopenmpt_stream_callbacks.h> + +#include <portaudio.h> + +#define BUFFERSIZE 1024 +#define SAMPLERATE 48000 + +static int16_t left[BUFFERSIZE]; +static int16_t right[BUFFERSIZE]; +static int16_t* const buffers[2] = {left,right}; + +int main(int argc,char* argv[]){ + FILE* file = 0; + openmpt_module* mod = 0; + size_t count = 0; + PaStream* stream = 0; + PaStreamParameters streamparameters; + memset(&streamparameters,0,sizeof(PaStreamParameters)); + file = fopen(argv[1],"rb"); + mod = openmpt_module_create(openmpt_stream_get_file_callbacks(),file,NULL,NULL); + fclose(file); + Pa_Initialize(); + streamparameters.device = Pa_GetDefaultOutputDevice(); + streamparameters.channelCount = 2; + streamparameters.sampleFormat = paInt16|paNonInterleaved; + streamparameters.suggestedLatency = 250*0.001; + Pa_OpenStream(&stream,NULL,&streamparameters,SAMPLERATE,paFramesPerBufferUnspecified,0,NULL,NULL); + Pa_StartStream(stream); + while(1){ + count = openmpt_module_read_stereo(mod,SAMPLERATE,BUFFERSIZE,left,right); + if(count==0){ + break; + } + Pa_WriteStream(stream,buffers,count); + } + Pa_StopStream(stream); + Pa_CloseStream(stream); + Pa_Terminate(); + return 0; +} Property changes on: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-csrc \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c (rev 0) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,63 @@ +/* + * libopenmpt_example_c_mem.c + * -------------------------- + * Purpose: libopenmpt C API simple example + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include <memory.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <libopenmpt/libopenmpt.h> + +#include <portaudio.h> + +#define BUFFERSIZE 1024 +#define SAMPLERATE 48000 + +static int16_t left[BUFFERSIZE]; +static int16_t right[BUFFERSIZE]; +static int16_t* const buffers[2] = {left,right}; + +int main(int argc,char* argv[]){ + FILE* file = 0; + size_t size = 0; + void* data = 0; + openmpt_module* mod = 0; + size_t count = 0; + PaStream* stream = 0; + PaStreamParameters streamparameters; + memset(&streamparameters,0,sizeof(PaStreamParameters)); + file = fopen(argv[1],"rb"); + fseek(file,0,SEEK_END); + size = ftell(file); + fseek(file,0,SEEK_SET); + data = malloc(size); + fread(data,1,size,file); + fclose(file); + mod = openmpt_module_create_from_memory(data,size,NULL,NULL); + free(data); + Pa_Initialize(); + streamparameters.device = Pa_GetDefaultOutputDevice(); + streamparameters.channelCount = 2; + streamparameters.sampleFormat = paInt16|paNonInterleaved; + streamparameters.suggestedLatency = 250*0.001; + Pa_OpenStream(&stream,NULL,&streamparameters,SAMPLERATE,paFramesPerBufferUnspecified,0,NULL,NULL); + Pa_StartStream(stream); + while(1){ + count = openmpt_module_read_stereo(mod,SAMPLERATE,BUFFERSIZE,left,right); + if(count==0){ + break; + } + Pa_WriteStream(stream,buffers,count); + } + Pa_StopStream(stream); + Pa_CloseStream(stream); + Pa_Terminate(); + return 0; +} Property changes on: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-csrc \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp (rev 0) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,46 @@ +/* + * libopenmpt_example_cpp.cpp + * -------------------------- + * Purpose: libopenmpt C++ API simple example + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include <fstream> +#include <vector> + +#include <libopenmpt/libopenmpt.hpp> + +#include <portaudio.h> + +int main( int argc, char * argv [] ) { + const std::size_t buffersize = 1024; + const std::int32_t samplerate = 48000; + std::vector<float> left( buffersize ); + std::vector<float> right( buffersize ); + float * buffers [2] = { left.data(), right.data() }; + std::ifstream file( argv[1], std::ios::binary ); + openmpt::module mod( file ); + Pa_Initialize(); + PaStream * stream = 0; + PaStreamParameters streamparameters; + std::memset( &streamparameters, 0, sizeof(PaStreamParameters) ); + streamparameters.device = Pa_GetDefaultOutputDevice(); + streamparameters.channelCount = 2; + streamparameters.sampleFormat = paFloat32 | paNonInterleaved; + streamparameters.suggestedLatency = 250 * 0.001; + Pa_OpenStream( &stream, NULL, &streamparameters, samplerate, paFramesPerBufferUnspecified, 0, NULL, NULL ); + Pa_StartStream( stream ); + while ( true ) { + std::size_t count = mod.read( samplerate, buffersize, left.data(), right.data() ); + if ( count == 0 ) { + break; + } + Pa_WriteStream( stream, buffers, count ); + } + Pa_StopStream( stream ); + Pa_CloseStream( stream ); + Pa_Terminate(); + return 0; +} Property changes on: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/libopenmpt.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.cpp (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt.cpp 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,47 @@ +/* + * libopenmpt.cpp + * -------------- + * Purpose: libopenmpt general implementation + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#include "BuildSettings.h" + +#include "libopenmpt_internal.h" +#include "libopenmpt.hpp" +#include "libopenmpt.h" + +#if defined( LIBOPENMPT_BUILD_DLL ) +#if defined( _WIN32 ) + +#include <windows.h> + +#ifndef NO_XMPLAY + +void xmp_openmpt_on_dll_load(); +void xmp_openmpt_on_dll_unload(); + +#endif // NOXMPLAY + +BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) { + #ifndef NO_XMPLAY + switch ( fdwReason ) { + case DLL_PROCESS_ATTACH: + #ifndef NO_XMPLAY + xmp_openmpt_on_dll_load(); + #endif // NOXMPLAY + break; + case DLL_PROCESS_DETACH: + #ifndef NO_XMPLAY + xmp_openmpt_on_dll_unload(); + #endif // NOXMPLAY + break; + } + #endif // NOXMPLAY + return TRUE; +} + +#endif +#endif Property changes on: trunk/OpenMPT/libopenmpt/libopenmpt.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/libopenmpt.h =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.h (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt.h 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,148 @@ +/* + * libopenmpt.h + * ------------ + * Purpose: libopenmpt public c interface + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#ifndef LIBOPENMPT_H +#define LIBOPENMPT_H + +#include "libopenmpt_config.h" +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +LIBOPENMPT_API int openmpt_is_compatible_version( uint32_t api_version ); + +LIBOPENMPT_API uint32_t openmpt_get_library_version(void); + +LIBOPENMPT_API uint32_t openmpt_get_core_version(void); + +#define OPENMPT_STRING_LIBRARY_VERSION "library_version" +#define OPENMPT_STRING_CORE_VERSION "core_version" +#define OPENMPT_STRING_BUILD "build" +#define OPENMPT_STRING_CREDITS "credits" +#define OPENMPT_STRING_CONTACT "contact" + +LIBOPENMPT_API void openmpt_free_string( const char * str ); + +LIBOPENMPT_API const char * openmpt_get_string( const char * key ); + +LIBOPENMPT_API const char * openmpt_get_supported_extensions(void); + +LIBOPENMPT_API int openmpt_is_extension_supported( const char * extension ); + +typedef int (*openmpt_stream_read_func)( void * stream, void * dst, int bytes ); +typedef int (*openmpt_stream_seek_func)( void * stream, int64_t offset, int whence ); +typedef int64_t (*openmpt_stream_tell_func)( void * stream ); + +typedef struct openmpt_stream_callbacks { + openmpt_stream_read_func read; + openmpt_stream_seek_func seek; + openmpt_stream_tell_func tell; +} openmpt_stream_callbacks; + +typedef void (*openmpt_log_func)( const char * message, void * user ); + +LIBOPENMPT_API void openmpt_log_func_default( const char * message, void * user ); + +LIBOPENMPT_API void openmpt_log_func_silent( const char * message, void * user ); + +LIBOPENMPT_API double openmpt_could_open_propability( openmpt_stream_callbacks stream_callbacks, void * stream, double effort, openmpt_log_func logfunc, void * user ); + +typedef struct openmpt_module openmpt_module; + +LIBOPENMPT_API openmpt_module * openmpt_module_create( openmpt_stream_callbacks stream_callbacks, void * stream, openmpt_log_func logfunc, void * user ); + +LIBOPENMPT_API openmpt_module * openmpt_module_create_from_memory( const void * filedata, size_t filesize, openmpt_log_func logfunc, void * user ); + +LIBOPENMPT_API void openmpt_module_destroy( openmpt_module * mod ); + +#define OPENMPT_MODULE_RENDER_MASTERGAIN_DB 1 +#define OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT 2 +#define OPENMPT_MODULE_RENDER_REPEATCOUNT 3 +#define OPENMPT_MODULE_RENDER_QUALITY_PERCENT 4 +#define OPENMPT_MODULE_RENDER_MAXMIXCHANNELS 5 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_MODE 6 +#define OPENMPT_MODULE_RENDER_VOLUMERAMP_IN_SAMPLES 7 +#define OPENMPT_MODULE_RENDER_VOLUMERAMP_OUT_SAMPLES 8 + +#define OPENMPT_MODULE_RENDER_INTERPOLATION_NEAREST 1 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_LINEAR 2 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_SPLINE 3 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_POLYPHASE 4 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_HANN 5 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_HAMMING 6 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMANEXACT 7 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMAN3T61 8 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMAN3T67 9 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMAN4T92 10 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_BLACKMAN4T74 11 +#define OPENMPT_MODULE_RENDER_INTERPOLATION_FIR_KAISER4T 12 + +#define OPENMPT_MODULE_COMMAND_NOTE 0 +#define OPENMPT_MODULE_COMMAND_INSTRUMENT 1 +#define OPENMPT_MODULE_COMMAND_VOLUMEEFFECT 2 +#define OPENMPT_MODULE_COMMAND_EFFECT 3 +#define OPENMPT_MODULE_COMMAND_VOLUME 4 +#define OPENMPT_MODULE_COMMAND_PARAMETER 5 + +LIBOPENMPT_API int openmpt_module_get_render_param( openmpt_module * mod, int command, int32_t * value ); +LIBOPENMPT_API int openmpt_module_set_render_param( openmpt_module * mod, int command, int32_t value ); + +LIBOPENMPT_API int openmpt_module_select_subsong( openmpt_module * mod, int32_t subsong ); + +LIBOPENMPT_API double openmpt_module_seek_seconds( openmpt_module * mod, double seconds ); + +LIBOPENMPT_API size_t openmpt_module_read_mono( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * mono ); +LIBOPENMPT_API size_t openmpt_module_read_stereo( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * left, int16_t * right ); +LIBOPENMPT_API size_t openmpt_module_read_quad( openmpt_module * mod, int32_t samplerate, size_t count, int16_t * left, int16_t * right, int16_t * back_left, int16_t * back_right ); +LIBOPENMPT_API size_t openmpt_module_read_float_mono( openmpt_module * mod, int32_t samplerate, size_t count, float * mono ); +LIBOPENMPT_API size_t openmpt_module_read_float_stereo( openmpt_module * mod, int32_t samplerate, size_t count, float * left, float * right ); +LIBOPENMPT_API size_t openmpt_module_read_float_quad( openmpt_module * mod, int32_t samplerate, size_t count, float * left, float * right, float * back_left, float * back_right ); + +LIBOPENMPT_API double openmpt_module_get_current_position_seconds( openmpt_module * mod ); + +LIBOPENMPT_API double openmpt_module_get_duration_seconds( openmpt_module * mod ); + +LIBOPENMPT_API const char * openmpt_module_get_metadata_keys( openmpt_module * mod ); +LIBOPENMPT_API const char * openmpt_module_get_metadata( openmpt_module * mod, const char * key ); + +LIBOPENMPT_API int32_t openmpt_module_get_current_speed( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_tempo( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_order( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_pattern( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_row( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_current_playing_channels( openmpt_module * mod ); + +LIBOPENMPT_API int32_t openmpt_module_get_num_subsongs( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_channels( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_orders( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_patterns( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_instruments( openmpt_module * mod ); +LIBOPENMPT_API int32_t openmpt_module_get_num_samples( openmpt_module * mod ); + +LIBOPENMPT_API const char * openmpt_module_get_subsong_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_channel_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_order_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_pattern_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_instrument_name( openmpt_module * mod, int32_t index ); +LIBOPENMPT_API const char * openmpt_module_get_sample_name( openmpt_module * mod, int32_t index ); + +LIBOPENMPT_API int32_t openmpt_module_get_order_pattern( openmpt_module * mod, int32_t order ); +LIBOPENMPT_API int32_t openmpt_module_get_pattern_num_rows( openmpt_module * mod, int32_t pattern ); + +LIBOPENMPT_API uint8_t openmpt_module_get_pattern_row_channel_command( openmpt_module * mod, int32_t pattern, int32_t row, int32_t channel, int command ); + +/* remember to add new functions to both C and C++ interfaces and to increase OPENMPT_API_VERSION_MINOR */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LIBOPENMPT_H */ Property changes on: trunk/OpenMPT/libopenmpt/libopenmpt.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/libopenmpt.hpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.hpp (rev 0) +++ trunk/OpenMPT/libopenmpt/libopenmpt.hpp 2013-05-11 14:51:10 UTC (rev 2014) @@ -0,0 +1,187 @@ +/* + * libopenmpt.hpp + * -------------- + * Purpose: libopenmpt public c++ interface + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#ifndef LIBOPENMPT_HPP +#define LIBOPENMPT_HPP + +#include "libopenmpt_config.h" + +#include <exception> +#include <iostream> +#include <istream> +#include <ostream> +#include <string> +#include <vector> + +#include <cstdint> + +namespace openmpt { + +class LIBOPENMPT_CXX_API exception : public std::exception { +public: + exception( const char * text ); +}; // class exception + +LIBOPENMPT_CXX_API std::uint32_t get_library_version(); + +LIBOPENMPT_CXX_API std::uint32_t get_core_version(); + +namespace detail { + +LIBOPENMPT_CXX_API void version_compatible_or_throw( std::int32_t api_version ); + +class api_version_checker { +public: + inline api_version_checker( std::int32_t api_version = OPENMPT_API_VERSION ) { + version_compatible_or_throw( api_version ); + } +}; // class api_version_checker + +} // namespace detail + +namespace string { + +static const char * const library_version = "library_version"; +static const char * const core_version = "core_version"; +static const char * const build = "build"; +static const char * const credits = "credits"; +static const char * const contact = "contact"; + +LIBOPENMPT_CXX_API std::string get( const std::string & key ); + +} // namespace string + +LIBOPENMPT_CXX_API std::vector<std::string> get_supported_extensions(); + +LIBOPENMPT_CXX_API bool is_extension_supported( const std::string & extension ); + +LIBOPENMPT_CXX_API double could_open_propability( std::istream & stream, double effort = 1.0, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + +class module_impl; + +class interactive_module; + +class LIBOPENMPT_CXX_API module { + + friend interactive_module; + +public: + + enum render_param { + RENDER_MASTERGAIN_DB = 1, + RENDER_STEREOSEPARATION_PERCENT = 2, + RENDER_REPEATCOUNT = 3, + RENDER_QUALITY_PERCENT = 4, + RENDER_MAXMIXCHANNELS = 5, + RENDER_INTERPOLATION_MODE = 6, + RENDER_VOLUMERAMP_IN_SAMPLES = 7, + RENDER_VOLUMERAMP_OUT_SAMPLES = 8, + }; + + enum interpolation_mode { + INTERPOLATION_NEAREST = 1, + INTERPOLATION_LINEAR = 2, + INTERPOLATION_SPLINE = 3, + INTERPOLATION_POLYPHASE = 4, + INTERPOLATION_FIR_HANN = 5, + INTERPOLATION_FIR_HAMMING = 6, + INTERPOLATION_FIR_BLACKMANEXACT = 7, + INTERPOLATION_FIR_BLACKMAN3T61 = 8, + INTERPOLATION_FIR_BLACKMAN3T67 = 9, + INTERPOLATION_FIR_BLACKMAN4T92 = 10, + INTERPOLATION_FIR_BLACKMAN4T74 = 11, + INTERPOLATION_FIR_KAISER4T = 12, + }; + + enum command_index { + command_note = 0, + command_instrument = 1, + command_volumeffect = 2, + command_effect = 3, + command_volume = 4, + command_parameter = 5, + }; + +private: + module_impl * impl; +private: + // non-copyable + module( const module & ); + void operator = ( const module & ); +private: + // for interactive_module + module(); + void set_impl( module_impl * i ); +public: + module( std::istream & stream, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const std::vector<std::uint8_t> & data, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const std::uint8_t * beg, const std::uint8_t * end, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const std::uint8_t * data, std::size_t size, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const std::vector<char> & data, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const char * beg, const char * end, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const char * data, std::size_t size, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + module( const void * data, std::size_t size, std::ostream & log = std::clog, const detail::api_version_checker & apicheck = detail::api_version_checker() ); + virtual ~module(); +public: + + std::int32_t get_render_param( int command ) const; + void set_render_param( int command, std::int32_t value ); + + void select_subsong( std::int32_t subsong ); + + double seek_seconds( double seconds ); + + std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * mono ); + std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right ); + std::size_t read( std::int32_t samplerate, std::size_t count, std::int16_t * left, std::int16_t * right, std::int16_t * back_left, std::int16_t * back_right ); + std::size_t read( std::int32_t samplerate, std::size_t count, float * mono ); + std::size_t read( std::int32_t samplerate, std::size_t count, float * left, float * right ); + std::size_t read( std::int32_t samplerate, std::size_t count, float * left, float * right, float * back_left, float * back_right ); + + double get_current_position_seconds() const; + + double get_duration_seconds() const; + + std::vector<std::string> get_metadata_keys() const; + std::string get_metadata( const std::string & key ) const; + + std::int32_t get_current_speed() const; + std::int32_t get_current_tempo() const; + std::int32_t get_current_order() const; + std::int32_t get_current_pattern() const; + std::int32_t get_current_row() const; + std::int32_t get_current_playing_channels() const; + + std::int32_t get_num_subsongs() const; + std::int32_t get_num_channels() const; + std::int32_t get_num_orders() const; + std::int32_t get_num_patterns() const; + std::int32_t get_num_instruments() const; + std::int32_t get_num_samples() const; + + std::vector<std::string> get_subsong_names() const; + std::vector<std::string> get_channel_names() const; + std::vector<std::string> get_order_names() const; + std::vector<std::string> get_pattern_names() const; + std::vector<std::string> get_instrument_names() const; + std::vector<std::string> get_sample_names() const; + + std::int32_t get_order_pattern( std::int32_t order ) const; + + std::int32_t get_pattern_num_rows( std::int32_t pattern ) const; + + std::uint8_t get_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel, int command ) const; + + // remember to add new functions to both C and C++ interfaces and to increase OPENMPT_API_VERSION_MINOR + +}; // class module + +} // namespace openmpt + +#endif // LIBOPENMPT_HPP Property changes on: trunk/OpenMPT/libopenmpt/libopenmpt.hpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++hdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline a... [truncated message content] |