Mercurial > audlegacy-plugins
annotate src/amidi-plug/amidi-plug.h @ 569:d401f87f89f7 trunk
[svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
author | giacomo |
---|---|
date | Mon, 29 Jan 2007 06:40:04 -0800 |
parents | 914c96de3244 |
children | fe9ffc829b5f |
rev | line source |
---|---|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1 /* |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
3 * Author: Giacomo Lozito <james@develia.org>, (C) 2005-2006 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
4 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify it |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License as published by the |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
7 * Free Software Foundation; either version 2 of the License, or (at your |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 * option) any later version. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
9 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, but |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
11 * WITHOUT ANY WARRANTY; without even the implied warranty of |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
13 * General Public License for more details. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
14 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License along |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
16 * with this program; if not, write to the Free Software Foundation, Inc., |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
18 * |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
20 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
21 #ifndef _I_AMIDIPLUG_H |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
22 #define _I_AMIDIPLUG_H 1 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
23 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
24 #define AMIDIPLUG_STOP 0 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
25 #define AMIDIPLUG_PLAY 1 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
26 #define AMIDIPLUG_PAUSE 2 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
27 #define AMIDIPLUG_ERR 3 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
28 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 #include "i_common.h" |
240
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
30 #include <audacious/plugin.h> |
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
31 #include <audacious/output.h> |
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
32 #include <audacious/beepctrl.h> |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
33 #include <pthread.h> |
240
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
34 #include "i_vfslayer.h" |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
35 #include "i_backend.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
36 #include "i_configure.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
37 #include "i_midi.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
38 #include "i_fileinfo.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
39 #include "i_utils.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
40 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
41 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
42 static pthread_t amidiplug_play_thread; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
43 static pthread_t amidiplug_audio_thread; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
44 static pthread_mutex_t amidiplug_gettime_mutex = PTHREAD_MUTEX_INITIALIZER; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
45 static pthread_mutex_t amidiplug_playing_mutex = PTHREAD_MUTEX_INITIALIZER; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
46 static pthread_cond_t amidiplug_playing_cond = PTHREAD_COND_INITIALIZER; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
47 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
48 gint amidiplug_playing_status = AMIDIPLUG_STOP; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
50 midifile_t midifile; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
51 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
52 amidiplug_sequencer_backend_t backend; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
53 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
54 amidiplug_cfg_ap_t amidiplug_cfg_ap = |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
55 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
56 NULL, /* ap_seq_backend */ |
240
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
57 0, /* ap_opts_transpose_value */ |
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
58 0, /* ap_opts_drumshift_value */ |
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
59 0, /* ap_opts_length_precalc */ |
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
60 0, /* ap_opts_comments_extract */ |
59d793da5395
[svn] - import amidi-plug 0.7 (among new features, a transposer to play midi files in different keys)
giacomo
parents:
12
diff
changeset
|
61 0 /* ap_opts_lyrics_extract */ |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
62 }; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
63 |
461 | 64 gchar *amidiplug_vfs_extensions[] = { "mid" , "midi" , "rmi" , "rmid" , NULL }; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
65 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 void * amidiplug_play_loop( void * ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
67 void * amidiplug_audio_loop( void * ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
68 void amidiplug_skipto( gint ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
69 static void amidiplug_init( void ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
70 static void amidiplug_cleanup( void ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
71 static void amidiplug_aboutbox( void ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
72 static void amidiplug_configure( void ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
73 static gint amidiplug_is_our_file( gchar * ); |
461 | 74 static gint amidiplug_is_our_file_from_vfs( gchar * , VFSFile * ); |
559 | 75 static void amidiplug_play( InputPlayback * ); |
76 static void amidiplug_stop( InputPlayback * ); | |
77 static void amidiplug_pause( InputPlayback *, gshort ); | |
78 static void amidiplug_seek( InputPlayback *, gint ); | |
79 static gint amidiplug_get_time( InputPlayback * ); | |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
80 static gint amidiplug_get_volume( gint * , gint * ); |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
81 static gint amidiplug_set_volume( gint , gint ); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
82 static void amidiplug_get_song_info( gchar * , gchar ** , gint * ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
83 static void amidiplug_file_info_box( gchar * ); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
84 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
85 InputPlugin amidiplug_ip = |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
86 { |
461 | 87 NULL, /* handle */ |
88 NULL, /* filename */ | |
89 NULL, /* description */ | |
90 amidiplug_init, /* init */ | |
91 amidiplug_aboutbox, /* aboutbox */ | |
92 amidiplug_configure, /* configure */ | |
93 amidiplug_is_our_file, /* is_our_file */ | |
94 NULL, /* scan_dir */ | |
95 amidiplug_play, /* play_file */ | |
96 amidiplug_stop, /* stop */ | |
97 amidiplug_pause, /* pause */ | |
98 amidiplug_seek, /* seek */ | |
99 NULL, /* set_eq */ | |
100 amidiplug_get_time, /* get_time */ | |
101 amidiplug_get_volume, /* get_volume */ | |
102 amidiplug_set_volume, /* set_volume */ | |
103 amidiplug_cleanup, /* cleanup */ | |
104 NULL, /* get_vis_type */ | |
105 NULL, /* add_vis_pcm */ | |
106 NULL, /* set_info */ | |
107 NULL, /* set_info_text */ | |
108 amidiplug_get_song_info, /* get_song_info */ | |
109 amidiplug_file_info_box, /* file_info_box */ | |
110 NULL, /* output */ | |
111 NULL, /* get_song_tuple */ | |
112 NULL, /* set_song_tuple */ | |
113 NULL, /* set_status_buffering */ | |
114 amidiplug_is_our_file_from_vfs, /* is_our_file_from_vfs */ | |
115 amidiplug_vfs_extensions /* vfs_extensions */ | |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
116 }; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
118 #endif /* !_I_AMIDIPLUG_H */ |