Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 202 lines (168 sloc) 6.339 kB
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
1 #pragma once
2
3 /*
4 * Copyright (C) 2005-2008 Team XBMC
5 * http://www.xbmc.org
6 *
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, write to
19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 * http://www.gnu.org/copyleft/gpl.html
21 *
22 */
23
c51b118 Merged cptspiff's code-reshuffle branch.
theuni authored
24 #include "threads/CriticalSection.h"
25 #include "utils/StdString.h"
26 #include "guilib/Key.h"
27 #include "threads/Thread.h"
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
28
29 #include <queue>
30
31 class CFileItem;
8557216 Cleaned up MediaPlay methods and added so it can start playback of a …
topfs2 authored
32 class CFileItemList;
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
33 class CGUIDialog;
34
35 // defines here
36 #define TMSG_DIALOG_DOMODAL 100
37 #define TMSG_EXECUTE_SCRIPT 102
38 #define TMSG_EXECUTE_BUILT_IN 103
39 #define TMSG_EXECUTE_OS 104
40
41 #define TMSG_MEDIA_PLAY 200
42 #define TMSG_MEDIA_STOP 201
43 #define TMSG_MEDIA_PAUSE 202
44 #define TMSG_MEDIA_RESTART 203
1323953 added: TMSG_MEDIA_UNPAUSE, will only unpause when the player is paused
bobo1on1 authored
45 #define TMSG_MEDIA_UNPAUSE 204
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
46
47 #define TMSG_PLAYLISTPLAYER_PLAY 210
48 #define TMSG_PLAYLISTPLAYER_NEXT 211
49 #define TMSG_PLAYLISTPLAYER_PREV 212
aa2a725 Added some threadsafe actions for playlistplayer
topfs2 authored
50 #define TMSG_PLAYLISTPLAYER_ADD 213
51 #define TMSG_PLAYLISTPLAYER_CLEAR 214
52 #define TMSG_PLAYLISTPLAYER_SHUFFLE 215
53 #define TMSG_PLAYLISTPLAYER_GET_ITEMS 216
112f568 merged: webinterface branch into trunk.
jmarshallnz authored
54 #define TMSG_PLAYLISTPLAYER_PLAY_SONG_ID 217
8a7542f added: JSONRPC AudioPlaylist.Insert *Playlist.Remove - Thanks Kabooga
malard authored
55 #define TMSG_PLAYLISTPLAYER_INSERT 218
56 #define TMSG_PLAYLISTPLAYER_REMOVE 219
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
57
58 #define TMSG_PICTURE_SHOW 220
59 #define TMSG_PICTURE_SLIDESHOW 221
60 #define TMSG_SLIDESHOW_SCREENSAVER 222
61
62 #define TMSG_SHUTDOWN 300
63 #define TMSG_POWERDOWN 301
64 #define TMSG_QUIT 302
65 #define TMSG_DASHBOARD TMSG_QUIT
66 #define TMSG_HIBERNATE 303
67 #define TMSG_SUSPEND 304
68 #define TMSG_RESTART 305
69 #define TMSG_RESET 306
70 #define TMSG_RESTARTAPP 307
71 #define TMSG_SWITCHTOFULLSCREEN 308
72 #define TMSG_MINIMIZE 309
a58360a [osx] add fullscreen toggle/float on top menu entries and hook them
davilla authored
73 #define TMSG_TOGGLEFULLSCREEN 310
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
74
75 #define TMSG_HTTPAPI 400
76
77 #define TMSG_NETWORKMESSAGE 500
78
79 #define TMSG_GUI_DO_MODAL 600
80 #define TMSG_GUI_SHOW 601
81 #define TMSG_GUI_ACTIVATE_WINDOW 604
bbd7476 changed: pass the python dialog show/close via the ApplicationMesseng…
jmarshallnz authored
82 #define TMSG_GUI_PYTHON_DIALOG 605
809b8bc fixed: Ticket #8361 - crash in some python scripts when closing dialogs
jmarshallnz authored
83 #define TMSG_GUI_DIALOG_CLOSE 606
4c93098 Send actions via appmessenger to ensure it is executed in appthread
topfs2 authored
84 #define TMSG_GUI_ACTION 607
bfb0ba2 @opdenkamp Revert "Merge remote branch 'upstream/master'"
opdenkamp authored
85 #define TMSG_GUI_INFOLABEL 608
86 #define TMSG_GUI_INFOBOOL 609
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
87
d5c23e3 cosmetics
spiff_ authored
88 #define TMSG_OPTICAL_MOUNT 700
89 #define TMSG_OPTICAL_UNMOUNT 701
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
90
aeae385 egl changes
Phaeodaria authored
91 #define TMSG_CALLBACK 800
92
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
93 typedef struct
94 {
95 DWORD dwMessage;
96 DWORD dwParam1;
97 DWORD dwParam2;
98 CStdString strParam;
99 std::vector<CStdString> params;
100 HANDLE hWaitEvent;
101 LPVOID lpVoid;
102 }
103 ThreadMessage;
104
88362c3 changed: use CThread for CDelayedMessage instead of CJob so we don't …
bobo1on1 authored
105 class CDelayedMessage : public CThread
81a4b37 added: CDelayedMessage, can be handed to the jobmanager to send a mes…
bobo1on1 authored
106 {
107 public:
108 CDelayedMessage(ThreadMessage& msg, unsigned int delay);
88362c3 changed: use CThread for CDelayedMessage instead of CJob so we don't …
bobo1on1 authored
109 virtual void Process();
81a4b37 added: CDelayedMessage, can be handed to the jobmanager to send a mes…
bobo1on1 authored
110
111 private:
112 unsigned int m_delay;
113 ThreadMessage m_msg;
114 };
115
aeae385 egl changes
Phaeodaria authored
116 struct ThreadMessageCallback
117 {
118 void (*callback)(void *userptr);
119 void *userptr;
120 };
121
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
122 class CApplicationMessenger
123 {
124
125 public:
126 ~CApplicationMessenger();
127
128 void Cleanup();
129 // if a message has to be send to the gui, use MSG_TYPE_WINDOW instead
130 void SendMessage(ThreadMessage& msg, bool wait = false);
131 void ProcessMessages(); // only call from main thread.
132 void ProcessWindowMessages();
133
134
135 void MediaPlay(std::string filename);
136 void MediaPlay(const CFileItem &item);
aa2a725 Added some threadsafe actions for playlistplayer
topfs2 authored
137 void MediaPlay(const CFileItemList &item, int song = 0);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
138 void MediaStop();
139 void MediaPause();
140 void MediaRestart(bool bWait);
141
142 void PlayListPlayerPlay();
143 void PlayListPlayerPlay(int iSong);
43b976b refactored PlayListPlayerPlaySongId to return a bool instead of take …
malard authored
144 bool PlayListPlayerPlaySongId(int songId);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
145 void PlayListPlayerNext();
146 void PlayListPlayerPrevious();
aa2a725 Added some threadsafe actions for playlistplayer
topfs2 authored
147 void PlayListPlayerAdd(int playlist, const CFileItem &item);
148 void PlayListPlayerAdd(int playlist, const CFileItemList &list);
149 void PlayListPlayerClear(int playlist);
150 void PlayListPlayerShuffle(int playlist, bool shuffle);
151 void PlayListPlayerGetItems(int playlist, CFileItemList &list);
8a7542f added: JSONRPC AudioPlaylist.Insert *Playlist.Remove - Thanks Kabooga
malard authored
152 void PlayListPlayerInsert(int playlist, const CFileItem &item, int position);
153 void PlayListPlayerInsert(int playlist, const CFileItemList &list, int position);
154 void PlayListPlayerRemove(int playlist, int position);
aa2a725 Added some threadsafe actions for playlistplayer
topfs2 authored
155
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
156 void PlayFile(const CFileItem &item, bool bRestart = false); // thread safe version of g_application.PlayFile()
157 void PictureShow(std::string filename);
dc7b566 changed: more specific use of the PictureSlideshow function in app me…
jmarshallnz authored
158 void PictureSlideShow(std::string pathname, bool bScreensaver = false, bool addTBN = false);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
159 void Shutdown();
160 void Powerdown();
161 void Quit();
162 void Hibernate();
163 void Suspend();
164 void Restart();
165 void RebootToDashBoard();
166 void RestartApp();
167 void Reset();
168 void SwitchToFullscreen(); //
d6b56e3 [all] add user event handling
davilla authored
169 void Minimize(bool wait = false);
d5c23e3 cosmetics
spiff_ authored
170 void ExecOS(const CStdString command, bool waitExit = false);
d6b56e3 [all] add user event handling
davilla authored
171 void UserEvent(int code);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
172
173 CStdString GetResponse();
174 int SetResponse(CStdString response);
175 void HttpApi(std::string cmd, bool wait = false);
48a7b51 added: UnloadSkin builtin function, and allow ApplicationMessenger::E…
jmarshallnz authored
176 void ExecBuiltIn(const CStdString &command, bool wait = false);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
177
178 void NetworkMessage(DWORD dwMessage, DWORD dwParam = 0);
179
180 void DoModal(CGUIDialog *pDialog, int iWindowID, const CStdString &param = "");
181 void Show(CGUIDialog *pDialog);
b49b0b3 fixed: Ticket #8721 - Slow Exit From XBMC
vdrfan authored
182 void Close(CGUIDialog *pDialog, bool forceClose, bool waitResult=true);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
183 void ActivateWindow(int windowID, const std::vector<CStdString> &params, bool swappingWindows);
e68bd02 @topfs2 Allow wait and no-wait on SendAction in ApplicationMessenger
topfs2 authored
184 void SendAction(const CAction &action, int windowID = WINDOW_INVALID, bool waitResult=true);
3dedd4a Added System.GetInfoBooleans and System.GetInfoLabels in jsonrpc
topfs2 authored
185 std::vector<CStdString> GetInfoLabels(const std::vector<CStdString> &properties);
186 std::vector<bool> GetInfoBooleans(const std::vector<CStdString> &properties);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
187
d5c23e3 cosmetics
spiff_ authored
188 void OpticalMount(CStdString device, bool bautorun=false);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
189 void OpticalUnMount(CStdString device);
190
191 private:
192 void ProcessMessage(ThreadMessage *pMsg);
193
194
195 std::queue<ThreadMessage*> m_vecMessages;
196 std::queue<ThreadMessage*> m_vecWindowMessages;
197 CCriticalSection m_critSection;
198 CCriticalSection m_critBuffer;
199 CStdString bufferResponse;
200
201 };
Something went wrong with that request. Please try again.