aboutsummaryrefslogtreecommitdiff
path: root/src/fs/extensions/musicinsert.h
blob: 2f8a346bd356672ddd5b15989037248869afed22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
     This file is part of GNUnet.
     (C) 2005 Christian Grothoff (and other contributing authors)

     GNUnet is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published
     by the Free Software Foundation; either version 2, or (at your
     option) any later version.

     GNUnet is distributed in the hope that it will be useful, but
     WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with GNUnet; see the file COPYING.  If not, write to the
     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.
*/

/**
 * @file src/musicinsert.h
 * @brief Music insertion dialog for gnunet-gtk
 * @author Milan Bouchet
 */

#ifndef MUSICINSERT_MAIN_H
#define MUSICINSERT_MAIN_H

#include <extractor.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
/* platform.h will be needed */
	

GladeXML *musicinsertXML;
GtkListStore *filelist_store;
GList *AlbumList, *ArtistList, *TypeList;
GtkComboBoxEntry *artistcombobox, *albumcombobox, *typecombobox;
EXTRACTOR_ExtractorList *Extractors;

GtkTreeViewColumn *filename_list_col, *title_list_col, *artist_list_col,
  *album_list_col, *type_list_col, *format_list_col, *keywords_list_col;

GtkWidget *filelist_popup;

/* Know music files mimetypes to list in the format ComboBoxEntry */
enum Types
{
  FORMAT_OGG = 0,
  FORMAT_MP3,
  FORMAT_MPC,
  FORMAT_AAC,
  FORMAT_WMA,
  FORMAT_FLAC,
  FORMAT_APE,
  FORMAT_WAV,
  FORMAT_MIDI,
  FORMAT_REAL
};

/* Columns IDs constants */
enum
{
  REAL_FILENAME_COL = 0,
  FILENAME_COL,
  TITLE_COL,
  ARTIST_COL,
  ALBUM_COL,
  TYPE_COL,
  FORMAT_COL,
  KEYWORDS_COL,
  COLS_NUMBER
};

/* Columns IDs  : need to be stored in a variable to be passed using a (void *) */
const gint filename_col_num = FILENAME_COL;
const gint title_col_num = TITLE_COL;
const gint artist_col_num = ARTIST_COL;
const gint album_col_num = ALBUM_COL;
const gint type_col_num = TYPE_COL;
const gint format_col_num = FORMAT_COL;
const gint keywords_col_num = KEYWORDS_COL;

/* Temp definitions to remove, will be present in platform.h from GNUnet source*/
 #define DIR_SEPARATOR '/'
 #define ACCESS(p, m) access(p, m)
 #define STRDUP(s) strdup (s)


EXTRACTOR_KeywordList *get_EXTRACTORKeywords (const EXTRACTOR_ExtractorList *
					      exList, const gchar * filename);
void set_File_Keywords (const gchar * filename);
void activateComboBoxes ();
void updateColumns ();
void show_musicinsertdialog ();

/* Callback functions declaration */
void on_musicinsertdialog_destroy (GtkObject * object, gpointer user_data);

void on_cancelbutton_clicked (GtkButton * button, gpointer user_data);

void on_okbutton_clicked (GtkButton * button, gpointer user_data);

void on_fileaddbutton_clicked (GtkButton * button, gpointer user_data);

void on_diraddbutton_clicked (GtkButton * button, gpointer user_data);

void
on_radioinsert_toggled (GtkRadioButton * radiobutton, gpointer user_data);

void on_radioindex_toggled (GtkRadioButton * radiobutton, gpointer user_data);

void
on_albumtogglebutton_toggled (GtkToggleButton * togglebutton,
			      gpointer user_data);

void
on_artisttogglebutton_toggled (GtkToggleButton * togglebutton,
			       gpointer user_data);

void
on_typetogglebutton_toggled (GtkToggleButton * togglebutton,
			     gpointer user_data);

void
on_keywordstogglebutton_toggled (GtkToggleButton * togglebutton,
				 gpointer user_data);

void
on_renderer_edited (GtkCellRendererText * cellrenderertext,
		    gchar * arg1, gchar * arg2, gpointer user_data);

gboolean popup_delete (GtkWidget * widget,
		       GdkEventButton * event, gpointer user_data);

void remove_file_from_list (gpointer user_data);

void select_all_files (gpointer user_data);


#endif