aboutsummaryrefslogtreecommitdiff
path: root/include/qmpcorepublic.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2023-11-26 01:10:36 -0500
committerGravatar Chris Xiong <chirs241097@gmail.com> 2023-11-26 01:10:36 -0500
commit60989e52b3f3bc0a95d3e61bd8e59fa4d9b7ab83 (patch)
treeaf08e5b6f7019c6f70bf3800a419ec78db140988 /include/qmpcorepublic.hpp
parent382d85b15ce9cc4580a2522b39f5dd4ce43a24b0 (diff)
downloadQMidiPlayer-60989e52b3f3bc0a95d3e61bd8e59fa4d9b7ab83.tar.xz
The 2 year constipation. (mpris plugin)
Probably buggy as hell.
Diffstat (limited to 'include/qmpcorepublic.hpp')
-rw-r--r--include/qmpcorepublic.hpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/include/qmpcorepublic.hpp b/include/qmpcorepublic.hpp
index 9e3e9e7..4fc90d8 100644
--- a/include/qmpcorepublic.hpp
+++ b/include/qmpcorepublic.hpp
@@ -77,6 +77,7 @@ public:
struct PlaybackStatus
{
bool paused;
+ bool stopped;
uint64_t curtime_ms;
uint64_t maxtime_ms;
uint64_t curtick;
@@ -153,6 +154,17 @@ public:
return "";
}
};
+enum PlaybackControlCommand
+{
+ Pause,
+ Play,
+ TogglePause,
+ Stop,
+ Seek, //uint32_t *percent
+ SeekAbs, //double *second
+ NextTrack,
+ PrevTrack
+};
#ifdef QMP_MAIN
extern "C" {
#endif
@@ -176,23 +188,34 @@ extern "C" {
virtual PlaybackStatus getPlaybackStatus() = 0;
virtual int getChannelCC(int ch, int cc) = 0;
virtual int getChannelPreset(int ch) = 0;
+ //Deprecated. Use playbackControl(Seek, (double*)&percentage) instead.
+ //Removing in 0.9.x.
virtual void playerSeek(uint32_t percentage) = 0;
virtual double getPitchBend(int ch) = 0;
virtual void getPitchBendRaw(int ch, uint32_t *pb, uint32_t *pbr) = 0;
virtual bool getChannelMask(int ch) = 0;
virtual std::string getTitle() = 0;
virtual std::wstring getWTitle() = 0;
+ virtual std::string getFilePath() = 0;
+ virtual std::wstring getWFilePath() = 0;
virtual std::string getChannelPresetString(int ch) = 0;
virtual bool isDarkTheme() = 0;
+ //Returns the qmpMainWindow instance. Use this as the parent widget
+ //if your plugin wants to create a child window.
+ //Do NOT call any non-virtual public functions through this pointer
+ //in the plugin.
+ //EXCEPTION: If your plugin links against Qt directly, you may call
+ //non-virtual members of the returned object inherited from Qt.
virtual void *getMainWindow() = 0;
+ virtual void playbackControl(PlaybackControlCommand cmd, void* data) = 0;
//WARNING!!: This function should be called from event reader callbacks only and
- //it is somehow dangerous -- other plugins might be unaware of the removal of the
- //event. The design might be modified afterward.
+ //it is somewhat dangerous -- other plugins might be unaware of the removal of the
+ //event. The design might be modified later.
virtual void discardCurrentEvent() = 0;
//WARNING!!: This function should be called from event reader callbacks only and
- //it is somehow dangerous -- other plugins might be unaware of the event change.
- //The design might be modified afterward.
+ //it is somewhat dangerous -- other plugins might be unaware of the event change.
+ //The design might be modified later.
virtual void commitEventChange(SEvent d) = 0;
//This function should be called from a file reader when it has read a new event
virtual void callEventReaderCB(SEvent d) = 0;