summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/WinterSpeak/general/multimedia
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-10-19 21:33:25 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-10-19 21:33:25 +0000
commitce83b46d4548feb14cc4fb521a22de135c5c6dfa (patch)
tree5357d9cdcd003abf4d917f61179d500b1cde6179 /plugins/!NotAdopted/WinterSpeak/general/multimedia
parentbd6ed4be499ccd60328ec16fcfc1a0a5664bbdc6 (diff)
Winter Speak has been adopted.
git-svn-id: http://svn.miranda-ng.org/main/trunk@6544 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!NotAdopted/WinterSpeak/general/multimedia')
-rw-r--r--plugins/!NotAdopted/WinterSpeak/general/multimedia/winamp_2/winamp_2.cpp157
-rw-r--r--plugins/!NotAdopted/WinterSpeak/general/multimedia/winamp_2/winamp_2.h62
2 files changed, 0 insertions, 219 deletions
diff --git a/plugins/!NotAdopted/WinterSpeak/general/multimedia/winamp_2/winamp_2.cpp b/plugins/!NotAdopted/WinterSpeak/general/multimedia/winamp_2/winamp_2.cpp
deleted file mode 100644
index 7ee65580ad..0000000000
--- a/plugins/!NotAdopted/WinterSpeak/general/multimedia/winamp_2/winamp_2.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-//==============================================================================
-// General Code, © 2002 Ryan Winter
-//==============================================================================
-
-#include "winamp_2.h"
-
-#include <general/debug/debug.h>
-
-#include <frontend.h>
-
-namespace
-{
- const int WINAMP_PLAY = WINAMP_BUTTON2;
- const int WINAMP_PAUSE = WINAMP_BUTTON3;
- const int WINAMP_STOP = WINAMP_BUTTON4;
-}
-
-//------------------------------------------------------------------------------
-// public:
-//------------------------------------------------------------------------------
-Winamp2::Winamp2()
- :
- m_state(PlayState_Unknown)
-{
- CLASSCERR("Winamp2::Winamp2");
-}
-
-//------------------------------------------------------------------------------
-Winamp2::~Winamp2()
-{
- CLASSCERR("Winamp2::~Winamp2");
-}
-
-//------------------------------------------------------------------------------
-void
-Winamp2::play()
-{
- CLASSCERR("Winamp2::play");
-
- HWND handle;
-
- if (getHandle(handle))
- {
- m_state = getState();
- SendMessage(handle, WM_COMMAND, WINAMP_PLAY, 0);
- }
-}
-
-//------------------------------------------------------------------------------
-void
-Winamp2::stop()
-{
- CLASSCERR("Winamp2::stop");
-
- HWND handle;
-
- if (getHandle(handle))
- {
- m_state = getState();
- SendMessage(handle, WM_COMMAND, WINAMP_STOP, 0);
- }
-}
-
-//------------------------------------------------------------------------------
-void
-Winamp2::pause()
-{
- CLASSCERR("Winamp2::pause");
-
- HWND handle;
-
- if (getHandle(handle))
- {
- m_state = getState();
-
- if (PlayState_Playing == m_state)
- {
- SendMessage(handle, WM_COMMAND, WINAMP_PAUSE, 0);
- }
- }
-}
-
-//------------------------------------------------------------------------------
-Winamp2::PlayState
-Winamp2::restoreState()
-{
- CLASSCERR("Winamp2::restoreState");
-
- switch (m_state)
- {
- case PlayState_Playing:
- play();
- break;
-
- case PlayState_Stopped:
- stop();
- break;
-
- case PlayState_Paused:
- pause();
- break;
- }
-
- return m_state;
-}
-
-//------------------------------------------------------------------------------
-// private:
-//------------------------------------------------------------------------------
-bool
-Winamp2::getHandle(HWND &handle)
-{
- handle = FindWindow("Winamp v1.x", NULL);
-
- bool ret = true;
-
- if (NULL == handle)
- {
- ret = false;
- }
-
- return ret;
-}
-
-//------------------------------------------------------------------------------
-Winamp2::PlayState
-Winamp2::getState()
-{
- CLASSCERR("Winamp2::getState");
-
- HWND handle;
-
- if (getHandle(handle))
- {
- int state = SendMessage(handle, WM_WA_IPC, 0, IPC_ISPLAYING);
-
- switch (state)
- {
- case 0:
- return PlayState_Stopped;
- break;
-
- case 1:
- return PlayState_Playing;
- break;
-
- case 3:
- return PlayState_Paused;
- break;
- }
- }
-
- return PlayState_Unknown;
-}
-
-//==============================================================================
-
diff --git a/plugins/!NotAdopted/WinterSpeak/general/multimedia/winamp_2/winamp_2.h b/plugins/!NotAdopted/WinterSpeak/general/multimedia/winamp_2/winamp_2.h
deleted file mode 100644
index 372d1e38d9..0000000000
--- a/plugins/!NotAdopted/WinterSpeak/general/multimedia/winamp_2/winamp_2.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef guard_general_multimedia_winamp_2_winamp_2_h
-#define guard_general_multimedia_winamp_2_winamp_2_h
-//==============================================================================
-// General Code, © 2002 Ryan Winter
-//==============================================================================
-
-#include <windows.h>
-
-class Winamp2
-{
- public:
- Winamp2();
- ~Winamp2();
-
- enum PlayState
- {
- PlayState_Unknown,
- PlayState_Stopped,
- PlayState_Playing,
- PlayState_Paused,
- };
-
- //--------------------------------------------------------------------------
- // Description : play/pause/stop the current song
- //--------------------------------------------------------------------------
- void play();
- void stop();
- void pause();
-
- //--------------------------------------------------------------------------
- // Description : restore winamp to its previoud play state
- // Return : the play state winamp has been restored to
- //--------------------------------------------------------------------------
- PlayState restoreState();
-
- private:
- //--------------------------------------------------------------------------
- // Description : get the handle to the winamp application
- // Parameters : handle - where to place the handle
- // Returns : true - the handle was found
- // false - the handle wasn't found
- //--------------------------------------------------------------------------
- bool getHandle(HWND &handle);
-
- //--------------------------------------------------------------------------
- // Description : get the current state of the winamp application
- //--------------------------------------------------------------------------
- PlayState getState();
-
- PlayState m_state;
-};
-
-//==============================================================================
-//
-// Summary : Control Winamp 2.x
-//
-// Description : Allows remote control over numberous winamp 2.x setting
-// including volume, play, pause, stop etc.
-//
-//==============================================================================
-
-#endif