diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Input/in_mod-openmpt/MODPlayer.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Plugins/Input/in_mod-openmpt/MODPlayer.h')
-rw-r--r-- | Src/Plugins/Input/in_mod-openmpt/MODPlayer.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Src/Plugins/Input/in_mod-openmpt/MODPlayer.h b/Src/Plugins/Input/in_mod-openmpt/MODPlayer.h new file mode 100644 index 00000000..be8fca01 --- /dev/null +++ b/Src/Plugins/Input/in_mod-openmpt/MODPlayer.h @@ -0,0 +1,44 @@ +#pragma once +#include <bfc/platform/types.h> +#include <libopenmpt/libopenmpt.h> +#include "../nu/AudioOutput.h" + +class MODPlayer +{ +public: + MODPlayer(const wchar_t *_filename); + ~MODPlayer(); + DWORD CALLBACK ThreadFunction(); + + void Kill(); + void Seek(int seek_pos); + int GetOutputTime() const; +private: + enum + { + // values that you can return from OnXXXX() + MOD_CONTINUE = 0, // continue processing + MOD_ABORT = 1, // abort parsing gracefully (maybe 'stop' was pressed) + MOD_STOP = 2, // stop parsing completely - usually returned when mkv version is too new or codecs not supported + + // values returned from errors within the Step() function itself + MOD_EOF = 3, // end of file + MOD_ERROR = 4, // parsing error + }; + + HANDLE killswitch, seek_event; + wchar_t *filename; + volatile int m_needseek; + + /* AudioOutput implementation */ + class MODWait + { + public: + void Wait_SetEvents(HANDLE killswitch, HANDLE seek_event); + protected: + int WaitOrAbort(int time_in_ms); + private: + HANDLE handles[2]; + }; + nu::AudioOutput<MODWait> audio_output; +};
\ No newline at end of file |