Re-add rating.
[gmpc.git] / src / main.h
blob2cc19f2a9c80c2b723d0700598a495fde843e069
1 /* Gnome Music Player Client (GMPC)
2 * Copyright (C) 2004-2012 Qball Cow <qball@gmpclient.org>
3 * Project homepage: http://gmpclient.org/
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef __MAIN_H__
22 #define __MAIN_H__
23 #include <config.h>
24 #include <gmpc-version.h>
25 #ifdef ENABLE_NLS
26 #ifndef __G_I18N_LIB_H__
27 #include <glib/gi18n.h>
28 #endif
29 #endif
31 #include "config-defaults.h"
32 #include <libmpd/libmpd.h>
33 #include <libmpd/libmpdclient.h>
34 #include "config1.h"
35 #include "plugin.h"
36 #include "plugin-internal.h"
37 #include "gmpc-extras.h"
38 #include "mpdinteraction.h"
40 #include "playlist3-messages.h"
43 /**
44 * Some gobjects
47 extern GtkApplication *gmpc_application;
49 extern int gmpc_connected;
50 extern GtkTreeModel *playlist;
52 /* the plugin list */
53 extern gmpcPluginParent **plugins;
54 /* num of plugins */
55 extern int num_plugins;
57 char * edit_song_markup(char *format);
59 void main_quit(void);
61 /* plugin */
62 void plugin_load_dir(const gchar *path);
63 void plugin_add(gmpcPlugin *plug, int plugin, GError **error);
64 void plugin_add_new(GmpcPluginBase *plug, int plugin, GError **error);
65 int plugin_get_pos(int id);
67 void show_error_message(const gchar *string);
70 /**
71 * TODO move this
73 void url_start_real(const gchar *url);
74 void url_start_easy_command(void *data,char *param, void *d );
75 void url_start(void);
77 void url_start_custom(const gchar *url,
78 void (*error_callback)(const gchar *error_msg, gpointer user_data),
79 void (*result_callback)(GList *result,gpointer user_data),
80 void (*progress_callback)(gdouble progress, gpointer user_data),
81 gpointer user_data);
83 * functions to get patch to different files.
84 * This is needed to make the windows port work.
85 * (misc.c)
87 char *gmpc_get_full_image_path(void);
89 /**
90 * Help functions
92 #define q_free(a) {g_free(a);a=NULL;}
94 /* tray stuff */
95 gboolean tray_icon2_get_available(void);
96 void tray_icon2_create_tooltip(void);
97 void tray_icon2_update_menu(void);
99 /* tag stuff */
101 void mpd_interaction_update_supported_tags(void);
103 * Playlist functions
106 /* Check if the playlist is fullscreen, this queries the _actual_ state */
107 gboolean pl3_window_is_fullscreen(void);
108 /* easy download */
109 void gmpc_easy_async_quit(void);
111 /**Hack Handle status changed */
112 void GmpcStatusChangedCallback(MpdObj *mi, ChangedStatusType what, void *userdata);
115 extern GmpcBrowsersMetadata *browsers_metadata;
116 #ifdef DEBUG_TIMING
117 /* Tic Tac system */
118 #define TIMER_SUB(start,stop,diff) diff.tv_usec = stop.tv_usec - start.tv_usec;\
119 diff.tv_sec = stop.tv_sec - start.tv_sec;\
120 if(diff.tv_usec < 0) {\
121 diff.tv_sec -= 1; \
122 diff.tv_usec += G_USEC_PER_SEC; \
125 #define INIT_TIC_TAC() GTimeVal start123, stop123,diff123;\
126 g_get_current_time(&start123);
128 #define TAC(a,ARGS...) g_get_current_time(&stop123);\
129 TIMER_SUB(start123, stop123, diff123);\
130 printf("%lu.%06lu:%s: "a"\n", (unsigned long)( diff123.tv_sec),(unsigned long)( diff123.tv_usec),__FUNCTION__,##ARGS);
132 #define TOC(a,ARGS...) TAC(a,##ARGS);\
133 start123 = stop123;
135 #else // DEBUG_TIMING
138 #define INIT_TIC_TAC() ;
139 #define TAC(a, ARGS...) ;
140 #define TOC(a, ARGS...) ;
142 #endif // DEBUG_TIMING
143 #define TEC(a, ARGS...) TAC(a, ##ARGS)
145 #endif