diff options
author | Pierre Grandin <grandinp@gmail.com> | 2017-05-07 21:28:11 -0700 |
---|---|---|
committer | Pierre Grandin <grandinp@gmail.com> | 2017-05-07 21:28:11 -0700 |
commit | 1cb7d234b91526612d290a141c7981ad1c5418b2 (patch) | |
tree | 1646ba76d8f73e8bc14e9923661c5351ddac9dec | |
parent | ce6cb5929ad06bb95ddc6412e32354ca62b5644b (diff) | |
download | navit-1cb7d234b91526612d290a141c7981ad1c5418b2.tar.gz |
Cleaning up an old dirty merge
-rw-r--r-- | navit/gui/internal/gui_internal_media.c | 159 |
1 files changed, 2 insertions, 157 deletions
diff --git a/navit/gui/internal/gui_internal_media.c b/navit/gui/internal/gui_internal_media.c index 2a9c786a4..8ae0d5970 100644 --- a/navit/gui/internal/gui_internal_media.c +++ b/navit/gui/internal/gui_internal_media.c @@ -1,4 +1,3 @@ -//* <<<<<<< HEAD /** * Navit, a modular navigation system. * Copyright (C) 2005-2016 Navit Team @@ -18,12 +17,7 @@ * Boston, MA 02110-1301, USA. */ -//*/ -/*=======*/ -/* -/* vim: set tabstop=4 expandtab: */ -//*/ -//>>>>>>> audio_framework + #include <glib.h> #include <navit/main.h> #include <navit/debug.h> @@ -40,18 +34,11 @@ #include "gui_internal_widget.h" #include "gui_internal_priv.h" #include "gui_internal_media.h" -//* <<<<<<< HEAD #include "gui_internal_command.h" -//*/ -/*=======*/ -/* -//*/ -//>>>>>>> audio_framework #include "audio.h" int currently_displayed_playlist=-1; -//* <<<<<<< HEAD static void tracks_free (gpointer data) { @@ -69,17 +56,11 @@ tracks_free (gpointer data) * wm - pointer the the parent widget * date - pointer to arbitrary data */ -//*/ -/*=======*/ -/* -//*/ -//>>>>>>> audio_framework void media_play_track (struct gui_priv *this, struct widget *wm, void *data) { dbg (lvl_info, "Got a request to play a specific track : %i\n", wm->c.x); audio_play_track(this->nav, wm->c.x); -//* <<<<<<< HEAD gui_internal_prune_menu(this, NULL); //gui_internal_media_show_playlist (this, NULL, NULL); } @@ -94,21 +75,10 @@ void media_play_playlist (struct gui_priv *this, struct widget *wm, void *data) { dbg (lvl_info, "Got a request to play a specific playlist : %i\n", wm->c.x); -//*/ -/*=======*/ -/* -} - -void -media_play_playlist (struct gui_priv *this, struct widget *wm, void *data) -{ -//*/ -//>>>>>>> audio_framework currently_displayed_playlist=wm->c.x; gui_internal_media_show_playlist (this, NULL, NULL); } -//* <<<<<<< HEAD /** * @brief Perform a media action * @param[in] this - pointer to the gui_priv @@ -153,53 +123,7 @@ media_action_do (struct gui_priv *this, struct widget *wm, void *data) } /** - * @brief Build a player 'toolbar' -//*/ -/*=======*/ -/* -void -media_play_toggle_offline_mode (struct gui_priv *this, struct widget *wm, void *data) -{ - /* - media_toggle_current_playlist_offline(); - gui_internal_media_show_playlist (this, wm, data); - * / -} - -/** - * @brief Build a track 'toolbar' - * @param[in] this - pointer to the gui_priv - * track_index - index of the track in the active playlist - * - * @return the resulting widget - * - * Builds a widget containing a button to start an echonest radio, - * and another button to display the state of the track and to start its playback - * - * / - -static struct widget * -gui_internal_media_track_toolbar (struct gui_priv *this, int track_index, char * track_name, char * track_icon) -{ - struct widget *wl, *wb; - wl = gui_internal_box_new (this, gravity_left_center | orientation_horizontal_vertical | flags_fill); - wl->w = this->root.w; - wl->cols = this->root.w / this->icon_s; - wl->h = this->icon_s; - gui_internal_widget_append (wl, wb = - gui_internal_button_new_with_callback (this, - track_name, - image_new_s - (this, track_icon), - gravity_left_center - | orientation_horizontal, media_play_track, NULL)); - wb->c.x = track_index; - gui_internal_widget_pack (this, wl); - return wl; -} - -/** - * @brief Build a playlist 'toolbat' + * @brief Build a playlist 'toolbar' * * @param[in] this - pointer to the gui_priv * @@ -214,13 +138,7 @@ gui_internal_media_playlist_toolbar (struct gui_priv *this) { struct widget *wl, *wb; int nitems, nrows; -//* <<<<<<< HEAD GList* actions = audio_get_actions(this->nav); -//*/ -/*=======*/ -/* -//*/ -//>>>>>>> audio_framework wl = gui_internal_box_new (this, gravity_left_center | orientation_horizontal_vertical | flags_fill); wl->background = this->background; wl->w = this->root.w; @@ -229,7 +147,6 @@ gui_internal_media_playlist_toolbar (struct gui_priv *this) nrows = nitems / wl->cols + (nitems % wl->cols > 0); wl->h = this->icon_l * nrows; wb = gui_internal_button_new_with_callback (this, "Playlists", -//* <<<<<<< HEAD image_new_s (this, "media_category"), gravity_left_center | orientation_horizontal, gui_internal_media_show_rootlist, NULL); @@ -247,25 +164,6 @@ gui_internal_media_playlist_toolbar (struct gui_priv *this) media_action_do, aa->action)); } } -//*/ -/*=======*/ -/* - image_new_s (this, "playlist"), - gravity_left_center | - orientation_horizontal, gui_internal_media_show_rootlist, NULL); - gui_internal_widget_append (wl, wb); - /* - gui_internal_widget_append (wl, wb = - gui_internal_button_new_with_callback (this, - "Offline", - image_new_s (this, media_get_current_playlist_status_icon ()), - gravity_left_center - | - orientation_horizontal, - media_play_toggle_offline_mode, NULL)); - */ -//*/ -//>>>>>>> audio_framework return wl; } @@ -300,25 +198,12 @@ gui_internal_media_show_rootlist (struct gui_priv *this, struct widget *wm, void while(playlists) { struct audio_playlist * pl=playlists->data; -//* <<<<<<< HEAD playlists=g_list_next(playlists); row = gui_internal_widget_table_row_new (this, gravity_left | flags_fill | orientation_horizontal); gui_internal_widget_append (tbl, row); wbm = gui_internal_button_new_with_callback (this, pl->name,image_new_s (this, (pl->icon) ? (pl->icon) : ("media_hierarchy")), -//*/ -/*=======*/ -/* - dbg(lvl_info,"Found playlist with name %s in the list\n", pl->name); - playlists=g_list_next(playlists); - row = gui_internal_widget_table_row_new (this, gravity_left | flags_fill | orientation_horizontal); - gui_internal_widget_append (tbl, row); - wbm = - gui_internal_button_new_with_callback (this, - pl->name,image_new_s (this, pl->icon), -//*/ -//>>>>>>> audio_framework gravity_left_center | orientation_horizontal | flags_fill, media_play_playlist, NULL); @@ -344,7 +229,6 @@ gui_internal_media_show_rootlist (struct gui_priv *this, struct widget *wm, void void gui_internal_media_show_playlist (struct gui_priv *this, struct widget *wm, void *data) { -//* <<<<<<< HEAD struct widget *wb, *w, *wbm; struct widget *tbl, *row; int index=0; @@ -362,33 +246,6 @@ gui_internal_media_show_playlist (struct gui_priv *this, struct widget *wm, void dbg(lvl_info, "\n\t%p\n\n", this); wb = gui_internal_menu (this, g_strdup_printf ("Media > %s", audio_get_current_playlist(this->nav))); -//*/ -/*=======*/ -/* - struct widget *wb, *w; - struct widget *tbl, *row; - GList *tracks = audio_get_tracks(this->nav,currently_displayed_playlist); - int index=0; - struct audio_playlist *pl; - - gui_internal_prune_menu_count (this, 1, 0); - - // Look in the playlists to get the current playlist name. Might not be optimal. - GList *playlists = audio_get_playlists(this->nav); - while(playlists && index!=currently_displayed_playlist) { - playlists=g_list_next(playlists); - index++; - } - - if (playlists) { - pl=playlists->data; - wb = gui_internal_menu (this, g_strdup_printf ("Media > %s", pl->name)); - } else { - wb = gui_internal_menu (this, g_strdup_printf ("Media > Unknown playlist")); - } - -//*/ -//>>>>>>> audio_framework wb->background = this->background; w = gui_internal_box_new (this, gravity_top_center | orientation_vertical | flags_expand | flags_fill); gui_internal_widget_append (wb, w); @@ -396,7 +253,6 @@ gui_internal_media_show_playlist (struct gui_priv *this, struct widget *wm, void tbl = gui_internal_widget_table_new (this, gravity_left_top | flags_fill | flags_expand | orientation_vertical, 1); gui_internal_widget_append (w, tbl); while(tracks) { -//* <<<<<<< HEAD struct audio_track * track=tracks->data; tracks=g_list_next(tracks); row = gui_internal_widget_table_row_new (this, gravity_left | flags_fill | orientation_horizontal); @@ -413,16 +269,5 @@ gui_internal_media_show_playlist (struct gui_priv *this, struct widget *wm, void } #endif g_list_free_full(tracks, tracks_free); -//*/ -/*=======*/ -/* - struct audio_track * track=tracks->data; - tracks=g_list_next(tracks); - row = gui_internal_widget_table_row_new (this, gravity_left | flags_fill | orientation_horizontal); - gui_internal_widget_append (tbl, row); - gui_internal_widget_append (row, gui_internal_media_track_toolbar (this, track->index, track->name, track->icon)); - } -//*/ -//>>>>>>> audio_framework gui_internal_menu_render (this); } |