~ubuntu-branches/ubuntu/oneiric/cairo-dock-plug-ins/oneiric-updates

« back to all changes in this revision

Viewing changes to musicPlayer/src/applet-struct.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe), Matthieu Baerts (matttbe), Iain Lane
  • Date: 2011-10-09 00:19:16 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20111009001916-9czstskx2t6l0b3x
Tags: 2.4.0~2-0ubuntu1
[ Matthieu Baerts (matttbe) ]
* New upstream bug fix release. (LP: #859984)
* Upstream (short) ChangeLog (2.4.0~0beta2 -> 2.4.0~1):
 - Powermanager: correctly release the reference on the device object
 - logout: now works if there is no session-manager
 - Status-Notifier: fixed a small bug
    (wrong callback in cairo_dock_stop_watching_dbus_name_owner)
 - Folders: fixed the positionning of the new icon
    and the dialog when dropping a folder inside the dock
    and fixed the icon-rendering
 - Dustbin: use the default theme if no icon is found
 - Impulse: the default context seems to be ok and not an error
 - Status-Notifier: On Ubuntu Oneiric (with indicator-0.4)
    the ApplicationAdded signal has changed and has a new parameter
 - Disable MeMenu on Oneiric (no longer available with indicator-0.4)
 - CMakeLists.txt: Improved output messages
 - Slide view: fixed a small offset in vertical view
 - musicPlayer:
  + split MPRIS 1.0 and 2.0 to help debugging and finding the right
     name of the bug.
  + 'rhythmbox-client' tool is no longer available: used MPRIS
  + Disable Amazon service (it no longer work)
  + Cover: fixed corrupted icons: some players (e.g. the latest version
     of RB) copy covers on their cache forlder but it takes a few time.
  + Fixed the update the icon and its name if the player is stopped.
  + Prevent a crash if the name given by MPRIS is NULL
 - Powermanager: try to prevent to have a few dialogues at the same time
 - PowerManager and AlsaMixer: hidden gnome2 or 3 apps if not available
 - Messaging-Menu: Updated for Natty and Oneiric
    (dbus-menu gives us GVariant instead of GValue objects)
 - Alsamixer: fixed a small bug on reload
 - Dbus: Bash interface: Fixed a typo with emblem positions
 - Sys-monitor: fixed a bug which prevented from getting
    the CPU temperature in some cases
 - Compiz (0.9): type filter: replaced type=utility by type=Utility
 - Updated the version of all applets that have gauges
   in order to use the right directory
 - Wifi: Fixed the status if we are not connected
 - Dbus: removed a conflict with the Help applet
 - Messaging-Menu: updated applet-menu.c => Memory leaks on pixbufs
 - Dbus: Fixed a crash when changing dock theme if a 'third-party' applet
    is running
 - Netspeed: in /proc/net/dev, there are 8 values to drop after the card id
    except if there is whitespaces just after this ':' character
    and fixed order and value for ON_ICON display
 - dock-rendering/toto: removed a useless file
 - Clipper: fixed the loading of the remembered items
    (they had the wrong type) and fixed a bug if we reduce the list of items
 - Folders, dustbin, Network-Monitor: tried to not use cast if it's possible
 - Code cleaned and re-organised a few functions
   (e.g. emblem references has been renamed)
 - Removed useless files: powermanager-dbus*
 - Updating translations
 - Fixed a few warnings at the compilation
 - Removed a few useless output messages
 - Fixed these LP bugs:
  + Empty trash from the trashcan does not delete files
     from usb harddisks: LP: #658681
  + Switcher applet doesn't respect desktop numbers LP: #626782
* Upstream (short) ChangeLog (2.4.0~1 -> 2.4.0~2):
 - Messaging-Menu: fixed a wrong g_object_unref (double free)
    and a small memory leak
 - Folders: fixed a tiny warning at the compilation (32bits)
 - switcher: removed an unnecessary config parameter
 - Folders: file size: used English instead of French translation.
 - Indicator applet: Forced a cast to remove an annoying warning
    due to clumsy dbusmenu_gtkmenu_new() declaration
 - Fixed the detection of the screensaver
 - Fixed tiny warnings at the compilation (with CAIRO_CONTAINER)
* debian/control:
 - Updated the version of cairo-dock-[core;data;dev].
 - Added gvfs as 'Suggests' for cairo-dock-plug-ins-integration
    (Used for managing files)
 - Removed 'libthunar-vfs-1-dev' (libthunar-vfs is no longer installed
    by default since XFCE 4.8 and it is replaced by gvfs)
 - Removed 'indicator-me' (no longer available
    and the installation of Cairo-Dock produces an error)
 - Moved 'indicator-messages' to 'Recommends'
* debian/rules:
 - Updated the name of CMake extras flags
* debian/cairo-dock-plug-ins-data.lintian-overrides:
 - Deleted (now useless)
* debian/cairo-dock-plug-ins.lintian-overrides:
 - Cairo-Dock Plug-Ins are not linked to gldi
 - shlib-without-versioned-soname: forwarded to upstream.
* debian/cairo-dock-plug-ins-integration.lintian-overrides:
 - Cairo-Dock Plug-Ins are not linked to gldi
 - ldconfig and shlibs are not needed
* debian/cairo-dock-plug-ins.install:
 - Fixed lintian errors: package-installs-python-bytecode
* debian/control: Fixed lintian warnings:
 - python-script-but-no-python-dep
 - description-synopsis-starts-with-article
* debian/changelog:
 - Fixed lintian warning: old-fsf-address-in-copyright-file
* debian/patches/01-switcher-force-compact-view.patch: 
 - Forced the compact view because the other doesn't work

[ Iain Lane ]
* Fix Mono/CLI build to be ~policy compliant and use correct compiler

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
*/
19
19
 
20
 
 
21
20
#ifndef __CD_APPLET_STRUCT__
22
21
#define  __CD_APPLET_STRUCT__
23
22
 
24
23
#include <cairo-dock.h>
25
24
 
26
25
//Canvas
27
 
typedef struct _MusicPlayerHandeler MusicPlayerHandeler;
28
 
 
29
 
// Players supportes
30
 
typedef enum {
31
 
        MP_RHYTHMBOX=0,
32
 
        MP_AMAROK2,
33
 
        MP_EXAILE,
34
 
        MP_EXAILE3,
35
 
        MP_LISTEN,
36
 
        MP_SONGBIRD,
37
 
        MP_QMMP,
38
 
        MP_GMUSICBROWSER,
39
 
        MP_GUAYADEQUE,
40
 
        MP_CLEMENTINE,
41
 
        MP_QUODLIBET,
42
 
        MP_BANSHEE,
43
 
        MP_AUDACIOUS,
44
 
        MP_XMMS2,
45
 
        MP_XMMS,
46
 
        MB_NB_PLAYERS
47
 
} MySupportedPlayers;
 
26
typedef struct _MusicPlayerHandler MusicPlayerHandler;
48
27
 
49
28
typedef enum {
50
29
        PLAYER_NONE = 0,
76
55
 
77
56
 
78
57
typedef void (*MusicPlayerGetDataFunc) (void);  // acquisition des donnees, threade.
79
 
typedef void (*MusicPlayerFreeDataFunc) (void);  // libere les ressources specifiques au backend (deconnexion des signaux, etc)
80
 
typedef void (*MusicPlayerConfigureFunc) (void);  // initialise le backend (connexion des signaux, etc)
 
58
typedef void (*MusicPlayerStopFunc) (void);  // libere les ressources specifiques au backend (deconnexion des signaux, etc)
 
59
typedef void (*MusicPlayerStartFunc) (void);  // initialise le backend (connexion des signaux, etc)
81
60
typedef void (*MusicPlayerControlerFunc) (MyPlayerControl pControl, const gchar *cFile);  // controle du lecteur (play/pause/next/etc)
82
61
typedef void (*MusicPlayerGetCoverFunc) (void);  // pour les lecteurs buggues, recupere la couverture. Renseigner ce champ fera que si le lecteur n'a pas renvoye de couverture au changement de chanson, on retentera 2 secondes plus tard avec cette fonction.
83
62
 
84
 
//A remplir lors du configure pour les players utilisant DBus.
85
 
typedef struct {
86
 
        const gchar *service;
87
 
        const gchar *path;
 
63
struct _MusicPlayerHandler {
 
64
        const gchar *name;  // nom du backend.
 
65
        MusicPlayerGetDataFunc          get_data;
 
66
        MusicPlayerStopFunc             stop;
 
67
        MusicPlayerStartFunc            start;
 
68
        MusicPlayerControlerFunc        control;
 
69
        MusicPlayerGetCoverFunc         get_cover;
 
70
        const gchar *cMprisService;  // old Dbus service name
 
71
        const gchar *path;  // Player object
88
72
        const gchar *interface;
89
 
        const gchar *path2;
 
73
        const gchar *path2;  // TrackList object.
90
74
        const gchar *interface2;
91
 
        const gchar *play;
92
 
        const gchar *pause;
93
 
        const gchar *play_pause;
94
 
        const gchar *stop;
95
 
        const gchar *next;
96
 
        const gchar *previous;
97
 
        const gchar *get_status;
98
 
        const gchar *get_title;
99
 
        const gchar *get_artist;
100
 
        const gchar *get_album;
101
 
        const gchar *get_cover_path;
102
 
        const gchar *duration;
103
 
        const gchar *current_position;
104
 
} MusicPlayerDBus;
105
 
 
106
 
struct _MusicPlayerHandeler {
107
 
        MusicPlayerGetDataFunc                  read_data;
108
 
        MusicPlayerFreeDataFunc                 free_data;
109
 
        MusicPlayerConfigureFunc                configure;
110
 
        MusicPlayerControlerFunc                control;
111
 
        MusicPlayerGetCoverFunc                 get_cover;
112
 
        const gchar *cMprisService;  // nom du service DBus si le lecteur respecte la norme MPRIS.
113
75
        const gchar *appclass;  // classe de l'appli.
114
 
        const gchar *name;  // nom du backend.
115
76
        const gchar *launch;  // commande lancant le lecteur.
116
77
        gchar *cCoverDir;  // repertoire utilisateur de l'appli, contenant les couvertures.
117
 
        gboolean bSeparateAcquisition;  // Sert a activer le thread ou pas (TRUE = activé; False = désactivé)
118
 
        MySupportedPlayers iPlayer;  // ID du backend.
 
78
        gboolean bSeparateAcquisition;  // Sert a activer le thread ou pas (TRUE = active; False = desactive)
119
79
        MyPlayerControl iPlayerControls;  // un masque "OU" de MyPlayerControl.
120
80
        MyLevel iLevel;
121
81
};
134
94
 
135
95
#define MP_DBUS_TYPE_SONG_METADATA (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))
136
96
 
 
97
#define CD_MPRIS2_SERVICE_BASE "org.mpris.MediaPlayer2"
 
98
#define CD_MPRIS2_OBJ /org/mpris/MediaPlayer2
 
99
#define CD_MPRIS2_MAIN_IFACE org.mpris.MediaPlayer2
137
100
 
138
101
struct _AppletConfig {
139
102
        gboolean bEnableDialogs;
156
119
};
157
120
 
158
121
struct _AppletData {
159
 
        //Pointeurs du canvas
 
122
        // general
160
123
        CairoDockTask *pTask;
161
 
        GList *pHandelers;
162
 
        MusicPlayerHandeler *pCurrentHandeler;
 
124
        GList *pHandlers;
 
125
        MusicPlayerHandler *pCurrentHandler;
 
126
        gchar *cMpris2Service;  // MPRIS2 service associated with the current handler.
163
127
        
164
128
        //Informations essentielles
165
129
        DBusGProxy *dbus_proxy_player;
169
133
        gchar *cArtist;
170
134
        gchar *cAlbum;
171
135
        gchar* cPlayingUri;
 
136
        gchar* cTrackID;
172
137
        MyPlayerStatus iPlayingStatus, pPreviousPlayingStatus;
173
138
        gint iTrackNumber, iPreviousTrackNumber;  // track number = position dans la play-list, et non pas numero de piste dans l'album (qui ne nous interesse pas).
174
139
        gint iCurrentTime, iPreviousCurrentTime, iGetTimeFailed;
178
143
        gint iTrackListIndex;
179
144
        
180
145
        // Pour les lecteurs utilisant DBus
181
 
        MusicPlayerDBus DBus_commands;
182
 
        gboolean dbus_enable;
183
 
        gboolean dbus_enable_shell;
184
146
        gboolean bIsRunning;
185
147
        DBusGProxyCall *pDetectPlayerCall;
186
148
        
187
 
        //Données de dessin
 
149
        //Donnees de dessin
188
150
        cairo_surface_t *pSurfaces[PLAYER_NB_STATUS];
189
151
        cairo_surface_t *pCover;
190
152
        
198
160
        gchar *cCurrentXmlFile;
199
161
        gboolean cover_exist;
200
162
        gboolean bCoverNeedsTest;
 
163
        gboolean bForceCoverNeedsTest; // some players copy covers on their cache folder but it takes a few time...
201
164
        
202
165
        // pochette 3D
203
166
        gint iCoverTransition;