ocarina: Clear out old ocarina::Playlist code
This class is slowly going away, and these functions have already been reimplemented using my GtkBuilder interface. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
69687ac6c6
commit
e8fd94cdeb
|
@ -31,8 +31,6 @@ namespace ocarina
|
|||
Playlist(libsaria::Playlist *);
|
||||
~Playlist();
|
||||
|
||||
void on_show();
|
||||
void on_hide();
|
||||
void right_click(guint, guint64);
|
||||
void select_none();
|
||||
void list_selected_tracks(list<libsaria::Track *> &);
|
||||
|
@ -40,18 +38,11 @@ namespace ocarina
|
|||
|
||||
void set_playlist(libsaria::Playlist *);
|
||||
void renumbered(int);
|
||||
void refilter();
|
||||
void track_updated(libsaria::Track *);
|
||||
void prepare_for_removal();
|
||||
void on_disable(bool);
|
||||
|
||||
void goto_index(unsigned int);
|
||||
|
||||
void modify_prepare();
|
||||
void insert(libsaria::Track *, unsigned int);
|
||||
void modify_done();
|
||||
|
||||
void remove_index(unsigned int);
|
||||
};
|
||||
|
||||
}; /* Namespace: ocarina */
|
||||
|
|
|
@ -13,47 +13,6 @@ static string formatted(string str)
|
|||
namespace ocarina
|
||||
{
|
||||
|
||||
void Playlist::modify_prepare()
|
||||
{
|
||||
gtk_widget_freeze_child_notify(treeview);
|
||||
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), NULL);
|
||||
}
|
||||
|
||||
void Playlist::insert(libsaria::Track *track, unsigned int index)
|
||||
{
|
||||
gtk_list_store_insert_with_values(liststore, NULL, index,
|
||||
0, track,
|
||||
1, track->get_track(),
|
||||
2, track->get_title().c_str(),
|
||||
3, track->get_lenstr().c_str(),
|
||||
4, track->get_artist().c_str(),
|
||||
5, track->get_album().c_str(),
|
||||
6, track->get_year(),
|
||||
7, track->get_count(),
|
||||
8, track->get_last_played().c_str(),
|
||||
9, formatted(track->get_filepath()).c_str(),
|
||||
-1);
|
||||
}
|
||||
|
||||
void Playlist::modify_done()
|
||||
{
|
||||
gtk_widget_thaw_child_notify(treeview);
|
||||
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), filter);
|
||||
set_label_text();
|
||||
if (playlist->get_size() == 0)
|
||||
gtk_widget_hide(box);
|
||||
else
|
||||
gtk_widget_show(box);
|
||||
}
|
||||
|
||||
void Playlist::remove_index(unsigned int index)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(liststore), &iter, NULL, index);
|
||||
gtk_list_store_remove(liststore, &iter);
|
||||
set_label_text();
|
||||
}
|
||||
|
||||
void Playlist::track_updated(libsaria::Track *track)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
|
|
@ -28,11 +28,6 @@ static void new_playlist(ocarina::Playlist *plist, PlaylistType type, bool front
|
|||
|
||||
plist->select_none();
|
||||
libsaria::deck::new_playlist(tracks, type, front);
|
||||
/*
|
||||
* The new playlist will set the length string text,
|
||||
* so reset it again here
|
||||
*/
|
||||
plist->on_show();
|
||||
}
|
||||
|
||||
static void new_queue_front(GtkMenuItem *menu, gpointer data)
|
||||
|
|
|
@ -102,17 +102,6 @@ namespace ocarina
|
|||
gtk_tree_selection_unselect_all(treesel);
|
||||
}
|
||||
|
||||
void Playlist::on_show()
|
||||
{
|
||||
visible = true;
|
||||
set_length_label_text();
|
||||
}
|
||||
|
||||
void Playlist::on_hide()
|
||||
{
|
||||
visible = false;
|
||||
}
|
||||
|
||||
void Playlist::goto_index(unsigned int index)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
|
|
|
@ -90,18 +90,6 @@ static GtkListStore *setup_liststore(GtkWidget *treeview)
|
|||
return liststore;
|
||||
}
|
||||
|
||||
static void mapped(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
ocarina::Playlist *plist = (ocarina::Playlist *)data;
|
||||
plist->on_show();
|
||||
}
|
||||
|
||||
static void unmapped(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
ocarina::Playlist *plist = (ocarina::Playlist *)data;
|
||||
plist->on_hide();
|
||||
}
|
||||
|
||||
namespace ocarina
|
||||
{
|
||||
|
||||
|
@ -122,8 +110,6 @@ namespace ocarina
|
|||
g_signal_connect(treeview, "row-activated", G_CALLBACK(track_selected), NULL);
|
||||
g_signal_connect(treeview, "button-release-event", G_CALLBACK(show_rc_menu), this);
|
||||
g_signal_connect(treeview, "key-press-event", G_CALLBACK(key_pressed), this);
|
||||
g_signal_connect(treeview, "map", G_CALLBACK(mapped), this);
|
||||
g_signal_connect(treeview, "unmap", G_CALLBACK(unmapped), this);
|
||||
|
||||
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE);
|
||||
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), filter);
|
||||
|
@ -138,11 +124,4 @@ namespace ocarina
|
|||
gtk_widget_show_all(scroll_win);
|
||||
}
|
||||
|
||||
void Playlist::refilter()
|
||||
{
|
||||
modify_prepare();
|
||||
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(filter));
|
||||
modify_done();
|
||||
}
|
||||
|
||||
}; /* Namespace: ocarina */
|
||||
|
|
Loading…
Reference in New Issue