annotate src/console/Audacious_Driver.cxx @ 1418:08a6320f7a2b

console: update to new tuple API
author William Pitcock <nenolod@atheme-project.org>
date Fri, 10 Aug 2007 06:05:54 -0500
parents 761e17b23e0c
children 195b5657303e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 * Audacious: Cross platform multimedia player
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
3 * Copyright (c) 2005-2006 Audacious Team
0
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 * Driver for Game_Music_Emu library. See details at:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
6 * http://www.slack.net/~ant/libs/
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
7 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
8
528
4d8b92b55acf [svn] - add config.h includes where needed
nenolod
parents: 527
diff changeset
9 #ifdef HAVE_CONFIG_H
4d8b92b55acf [svn] - add config.h includes where needed
nenolod
parents: 527
diff changeset
10 # include "config.h"
4d8b92b55acf [svn] - add config.h includes where needed
nenolod
parents: 527
diff changeset
11 #endif
4d8b92b55acf [svn] - add config.h includes where needed
nenolod
parents: 527
diff changeset
12
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13 #include <glib.h>
527
d124034ebea3 [svn] - glib/gi18n.h -> audacious/i18n.h for automatic dgettext support
nenolod
parents: 385
diff changeset
14 #include <audacious/i18n.h>
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
15 #include <gtk/gtk.h>
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
16 extern "C" {
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
17 #include "audacious/main.h"
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
18 #include "audacious/tuple.h"
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
19 #include "audacious/tuple_formatter.h"
3
088092a52fea [svn] - move from (internal) libaudacious/ include path to audacious/ include path
nenolod
parents: 0
diff changeset
20 #include "audacious/util.h"
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21 #include "audacious/output.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
22 #include "audacious/playlist.h"
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 #include <string.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
25 #include <stdlib.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
26 #include <math.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
27
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
28 // configdb and prefs ui
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
29 #include "Audacious_Config.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
30
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
31 #include "Music_Emu.h"
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
32 #include "Gzip_Reader.h"
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
33
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
34 int const fade_threshold = 10 * 1000;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
35 int const fade_length = 8 * 1000;
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
36 int const path_max = 4096;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
37
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
38 AudaciousConsoleConfig audcfg = { 180, FALSE, 32000, TRUE, 0, 0, FALSE, 0 };
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
39 static GThread* decode_thread;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
40 static GStaticMutex playback_mutex = G_STATIC_MUTEX_INIT;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
41 static int console_ip_is_going;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
42 static volatile long pending_seek;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
43 extern InputPlugin console_ip;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
44 static Music_Emu* emu = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
45
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
46 static blargg_err_t log_err( blargg_err_t err )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
47 {
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
48 if ( err )
380
1397798646fb [svn] - change use of printf to g_warning() and g_critical() where appropriate.
nenolod
parents: 378
diff changeset
49 g_critical( "console error: %s\n", err );
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
50 return err;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
51 }
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
52
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
53 static void log_warning( Music_Emu* emu )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
54 {
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
55 const char* w = emu->warning();
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
56 if ( w )
380
1397798646fb [svn] - change use of printf to g_warning() and g_critical() where appropriate.
nenolod
parents: 378
diff changeset
57 g_warning( "console warning: %s\n", w );
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
58 }
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
59
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
60 static void unload_file()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
61 {
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
62 if ( emu )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
63 log_warning( emu );
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
64 gme_delete( emu );
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
65 emu = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
66 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
67
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
68 // Handles URL parsing, file opening and identification, and file loading.
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
69 // Keeps file header around when loading rest of file to avoid seeking
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
70 // and re-reading.
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
71 class File_Handler {
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
72 public:
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
73 gchar* path; // path without track number specification
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
74 int track; // track number (0 = first track)
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
75 bool track_specified; // false if no track number was specified in path
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
76 Music_Emu* emu; // set to 0 to take ownership
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
77 gme_type_t type;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
78
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
79 // Parses path and identifies file type
385
ac806e416c48 [svn] - some improvements for chiptune expansion efficiency
nenolod
parents: 382
diff changeset
80 File_Handler( const char* path, VFSFile* fd = 0, gboolean is_our_file_hack = FALSE );
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
81
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
82 // Creates emulator and returns 0. If this wasn't a music file or
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
83 // emulator couldn't be created, returns 1.
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
84 int load( long sample_rate );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
85
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
86 // Deletes owned emu and closes file
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
87 ~File_Handler();
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
88 private:
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
89 char header [4];
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
90 Vfs_File_Reader vfs_in;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
91 Gzip_Reader in;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
92 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
93
385
ac806e416c48 [svn] - some improvements for chiptune expansion efficiency
nenolod
parents: 382
diff changeset
94 File_Handler::File_Handler( const char* path_in, VFSFile* fd, gboolean is_our_file_hack )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
95 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
96 emu = 0;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
97 type = 0;
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
98 track = 0;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
99 track_specified = false;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
100
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
101 path = g_strdup( path_in );
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
102 if ( !path )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
103 return; // out of memory
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
104
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
105 // extract track number
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
106 gchar* args = strchr( path, '?' ); // TODO: use strrchr()?
752
560292f1ebb3 [svn] - fix a stupid C++ error
nenolod
parents: 751
diff changeset
107 if ( args && g_ascii_isdigit( (guchar) *(args + 1) ) )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
108 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
109 *args = '\0';
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
110 // TODO: use func with better error reporting, and perhaps don't
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
111 // truncate path if there is no number after ?
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
112 track = atoi( args + 1 );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
113 track_specified = true;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
114 }
381
53056ce7940d [svn] - avoid opening VFS FDs for track URIs where we know that the file is valid
nenolod
parents: 380
diff changeset
115
53056ce7940d [svn] - avoid opening VFS FDs for track URIs where we know that the file is valid
nenolod
parents: 380
diff changeset
116 // if the track is specified, then we have a match. don't worry
53056ce7940d [svn] - avoid opening VFS FDs for track URIs where we know that the file is valid
nenolod
parents: 380
diff changeset
117 // about it right now -nenolod
385
ac806e416c48 [svn] - some improvements for chiptune expansion efficiency
nenolod
parents: 382
diff changeset
118 if (track_specified && is_our_file_hack)
381
53056ce7940d [svn] - avoid opening VFS FDs for track URIs where we know that the file is valid
nenolod
parents: 380
diff changeset
119 return;
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
120
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
121 // open vfs
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
122 if ( fd )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
123 vfs_in.reset( fd );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
124 else if ( log_err( vfs_in.open( path ) ) )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
125 return;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
126
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
127 // now open gzip_reader on top of vfs
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
128 if ( log_err( in.open( &vfs_in ) ) )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
129 return;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
130
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
131 // read and identify header
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
132 if ( !log_err( in.read( header, sizeof header ) ) )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
133 {
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
134 type = gme_identify_extension( gme_identify_header( header ) );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
135 if ( !type )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
136 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
137 type = gme_identify_extension( path );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
138 if ( type != gme_gym_type ) // only trust file extension for headerless .gym files
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
139 type = 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
140 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
141 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
142 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
143
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
144 File_Handler::~File_Handler()
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
145 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
146 gme_delete( emu );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
147 g_free( path );
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
148 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
149
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
150 int File_Handler::load( long sample_rate )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
151 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
152 if ( !type )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
153 return 1;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
154
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
155 emu = gme_new_emu( type, sample_rate );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
156 if ( !emu )
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
157 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
158 log_err( "Out of memory" );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
159 return 1;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
160 }
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
161
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
162 {
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
163 // combine header with remaining file data
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
164 Remaining_Reader reader( header, sizeof header, &in );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
165 if ( log_err( emu->load( reader ) ) )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
166 return 1;
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
167 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
168
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
169 // files can be closed now
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
170 in.close();
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
171 vfs_in.close();
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
172
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
173 log_warning( emu );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
174
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
175 // load .m3u from same directory( replace/add extension with ".m3u")
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
176 char m3u_path [path_max + 5];
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
177 strncpy( m3u_path, path, path_max );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
178 m3u_path [path_max] = 0;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
179 // TODO: use better path-building functions
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
180 char* p = strrchr( m3u_path, '.' );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
181 if ( !p )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
182 p = m3u_path + strlen( m3u_path );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
183 strcpy( p, ".m3u" );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
184
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
185 Vfs_File_Reader m3u;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
186 if ( !m3u.open( m3u_path ) )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
187 {
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
188 if ( log_err( emu->load_m3u( m3u ) ) ) // TODO: fail if m3u can't be loaded?
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
189 log_warning( emu ); // this will log line number of first problem in m3u
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
190 }
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
191
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
192 return 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
193 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
194
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
195 // Get info
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
196
603
73ae7a6d510e [svn] - don't fill in tuple fields with "".
nenolod
parents: 582
diff changeset
197 static inline gchar *selective_strdup(const gchar *in)
73ae7a6d510e [svn] - don't fill in tuple fields with "".
nenolod
parents: 582
diff changeset
198 {
73ae7a6d510e [svn] - don't fill in tuple fields with "".
nenolod
parents: 582
diff changeset
199 if (in == NULL || *in == '\0')
73ae7a6d510e [svn] - don't fill in tuple fields with "".
nenolod
parents: 582
diff changeset
200 return NULL;
73ae7a6d510e [svn] - don't fill in tuple fields with "".
nenolod
parents: 582
diff changeset
201
73ae7a6d510e [svn] - don't fill in tuple fields with "".
nenolod
parents: 582
diff changeset
202 return g_strdup(in);
73ae7a6d510e [svn] - don't fill in tuple fields with "".
nenolod
parents: 582
diff changeset
203 }
73ae7a6d510e [svn] - don't fill in tuple fields with "".
nenolod
parents: 582
diff changeset
204
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
205 static Tuple* get_track_ti( const char* path, track_info_t const& info, int track )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
206 {
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
207 Tuple* ti = tuple_new();
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
208 if ( ti )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
209 {
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
210 tuple_associate_string(ti, "file-name", g_path_get_basename(path));
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
211 tuple_associate_string(ti, "file-path", g_path_get_dirname(path));
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
212 tuple_associate_string(ti, "artist", info.author);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
213 tuple_associate_string(ti, "album", info.game);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
214 tuple_associate_string(ti, "game", info.game);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
215 tuple_associate_string(ti, "title", info.song ? info.song : g_path_get_basename(path));
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
216 if ( info.track_count > 1 )
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
217 {
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
218 tuple_associate_int(ti, "track-number", track + 1);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
219 tuple_associate_int(ti, "subsong", track);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
220 }
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
221 tuple_associate_string(ti, "copyright", info.copyright);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
222 tuple_associate_string(ti, "console", info.system);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
223 tuple_associate_string(ti, "codec", info.system);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
224 tuple_associate_string(ti, "quality", "sequenced");
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
225 tuple_associate_string(ti, "dumper", info.dumper);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
226 tuple_associate_string(ti, "comment", info.comment);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
227
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
228 int length = info.length;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
229 if ( length <= 0 )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
230 length = info.intro_length + 2 * info.loop_length;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
231 if ( length <= 0 )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
232 length = audcfg.loop_length * 1000;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
233 else if ( length >= fade_threshold )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
234 length += fade_length;
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
235 tuple_associate_int(ti, "length", length);
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
236 }
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
237 return ti;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
238 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
239
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
240 static char* format_and_free_ti( Tuple* ti, int* length )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
241 {
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
242 char* result = tuple_formatter_process_string(ti, cfg.gentitle_format);
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
243 if ( result )
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
244 *length = tuple_get_int(ti, "length");
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
245 mowgli_object_unref((void *) ti);
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
246
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
247 return result;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
248 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
249
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
250 static Tuple *get_song_tuple( gchar *path )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
251 {
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
252 Tuple* result = 0;
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
253 File_Handler fh( path );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
254 if ( !fh.load( gme_info_only ) )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
255 {
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
256 track_info_t info;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
257 if ( !log_err( fh.emu->track_info( &info, fh.track ) ) )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
258 result = get_track_ti( fh.path, info, fh.track );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
259 }
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
260 return result;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
261 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
262
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
263 static void get_song_info( char* path, char** title, int* length )
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
264 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
265 *length = -1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
266 *title = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
267
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
268 Tuple* ti = get_song_tuple( path );
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
269 if ( ti )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
270 *title = format_and_free_ti( ti, length );
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
271 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
272
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
273 // Playback
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
274
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
275 static void* play_loop_track( gpointer arg )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
276 {
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
277 InputPlayback *playback = (InputPlayback *) arg;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
278 g_static_mutex_lock( &playback_mutex );
1184
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
279
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
280 int end_delay = 0;
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
281 while ( console_ip_is_going )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
282 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
283 // handle pending seek
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
284 long s = pending_seek;
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
285 pending_seek = -1; // TODO: use atomic swap
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
286 if ( s >= 0 )
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
287 {
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
288 playback->output->flush( s * 1000 );
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
289 emu->seek( s * 1000 );
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
290 }
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
291
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
292 // fill and play buffer of audio
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
293 // TODO: see if larger buffer helps efficiency
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
294 int const buf_size = 1024;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
295 Music_Emu::sample_t buf [buf_size];
1184
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
296 if ( end_delay )
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
297 {
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
298 // TODO: remove delay once host doesn't cut the end of track off
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
299 if ( !--end_delay )
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
300 console_ip_is_going = false;
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
301 memset( buf, 0, sizeof buf );
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
302
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
303 }
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
304 else
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
305 {
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
306 emu->play( buf_size, buf );
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
307 if ( emu->track_ended() )
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
308 {
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
309 double const seconds = 3;
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
310 end_delay = emu->sample_rate() * (int) (seconds * 2) / buf_size;
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
311 }
6d03915421e2 Possibly fix bug #850. Patch from P2E.
William Pitcock <nenolod@atheme.org>
parents: 1069
diff changeset
312 }
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
313 produce_audio( playback->output->written_time(),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
314 FMT_S16_NE, 1, sizeof buf, buf,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
315 &console_ip_is_going );
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
316 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
317
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
318 // stop playing
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
319 unload_file();
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
320 playback->output->close_audio();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
321 console_ip_is_going = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
322 g_static_mutex_unlock( &playback_mutex );
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
323 return NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
324 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
325
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
326 static void play_file( InputPlayback *playback )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
327 {
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
328 char* path = playback->filename;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
329 unload_file();
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
330
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
331 // identify file
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
332 File_Handler fh( path );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
333 if ( !fh.type )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
334 return;
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
335
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
336 // select sample rate
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
337 long sample_rate = 0;
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
338 if ( fh.type == gme_spc_type )
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
339 sample_rate = 32000;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
340 if ( audcfg.resample )
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
341 sample_rate = audcfg.resample_rate;
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
342 if ( !sample_rate )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
343 sample_rate = 44100;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
344
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
345 // create emulator and load file
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
346 if ( fh.load( sample_rate ) )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
347 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
348
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
349 // stereo echo depth
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
350 gme_set_stereo_depth( fh.emu, 1.0 / 100 * audcfg.echo );
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
351
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
352 // set equalizer
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
353 if ( audcfg.treble || audcfg.bass )
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
354 {
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
355 Music_Emu::equalizer_t eq;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
356
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
357 // bass - logarithmic, 2 to 8194 Hz
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
358 double bass = 1.0 - (audcfg.bass / 200.0 + 0.5);
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
359 eq.bass = (long) (2.0 + pow( 2.0, bass * 13 ));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
360
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
361 // treble - -50 to 0 to +5 dB
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
362 double treble = audcfg.treble / 100.0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
363 eq.treble = treble * (treble < 0 ? 50.0 : 5.0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
364
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
365 fh.emu->set_equalizer(eq);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
366 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
367
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
368 // get info
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
369 int length = -1;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
370 track_info_t info;
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
371 if ( !log_err( fh.emu->track_info( &info, fh.track ) ) )
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
372 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
373 if ( fh.type == gme_spc_type && audcfg.ignore_spc_length )
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
374 info.length = -1;
1418
08a6320f7a2b console: update to new tuple API
William Pitcock <nenolod@atheme-project.org>
parents: 1395
diff changeset
375 Tuple* ti = get_track_ti( fh.path, info, fh.track );
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
376 if ( ti )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
377 {
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
378 char* title = format_and_free_ti( ti, &length );
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
379 if ( title )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
380 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
381 console_ip.set_info( title, length, fh.emu->voice_count() * 1000, sample_rate, 2 );
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
382 g_free( title );
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
383 }
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
384 }
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
385 }
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
386
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
387 // start track
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
388 if ( log_err( fh.emu->start_track( fh.track ) ) )
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
389 return;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
390 log_warning( fh.emu );
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
391 if ( !playback->output->open_audio( FMT_S16_NE, sample_rate, 2 ) )
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
392 return;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
393
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
394 // set fade time
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
395 if ( length <= 0 )
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
396 length = audcfg.loop_length * 1000;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
397 if ( length >= fade_threshold + fade_length )
648
0eca44731221 [svn] - fix timing on fades
nenolod
parents: 603
diff changeset
398 length -= fade_length / 2;
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
399 fh.emu->set_fade( length, fade_length );
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
400
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
401 // take ownership of emu
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
402 emu = fh.emu;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
403 fh.emu = 0;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
404
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
405 pending_seek = -1;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
406 console_ip_is_going = 1;
1348
d427f353e326 console: new threading model
William Pitcock <nenolod@atheme-project.org>
parents: 1185
diff changeset
407 decode_thread = g_thread_self();
d427f353e326 console: new threading model
William Pitcock <nenolod@atheme-project.org>
parents: 1185
diff changeset
408 play_loop_track( playback );
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
409 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
410
559
d5782f3bd760 [svn] Update plugins to the new input plugin API
iabervon
parents: 528
diff changeset
411 static void seek( InputPlayback * data, gint time )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
412 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
413 // TODO: use thread-safe atomic set
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
414 pending_seek = time;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
415 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
416
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
417 static void console_stop(InputPlayback *playback)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
418 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
419 console_ip_is_going = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
420 if ( decode_thread )
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
421 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
422 g_thread_join( decode_thread );
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
423 decode_thread = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
424 }
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
425 playback->output->close_audio();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
426 unload_file();
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
427 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
428
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
429 static void console_pause(InputPlayback * playback, gshort p)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
430 {
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
431 playback->output->pause(p);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
432 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
433
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
434 static int get_time(InputPlayback *playback)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
435 {
561
914c96de3244 [svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents: 559
diff changeset
436 return console_ip_is_going ? playback->output->output_time() : -1;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
437 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
438
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
439 static gint is_our_file_from_vfs( gchar* path, VFSFile* fd )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
440 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
441 gint result = 0;
385
ac806e416c48 [svn] - some improvements for chiptune expansion efficiency
nenolod
parents: 382
diff changeset
442 File_Handler fh( path, fd, TRUE );
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
443 if ( fh.type )
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
444 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
445 if ( fh.track_specified || fh.type->track_count == 1 )
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
446 {
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
447 // don't even need to read file if track is specified or
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
448 // that file format can't have more than one track per file
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
449 result = 1;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
450 }
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
451 else if ( !fh.load( gme_info_only ) )
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
452 {
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
453 // format requires reading file info to get track count
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
454 if ( fh.emu->track_count() == 1 )
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
455 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
456 result = 1;
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
457 }
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
458 else
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
459 {
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
460 // for multi-track types, add each track to playlist
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
461 for (int i = 0; i < fh.emu->track_count(); i++)
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
462 {
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
463 gchar _buf[path_max];
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
464 g_snprintf(_buf, path_max, "%s?%d", fh.path, i);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
465
363
958855dae693 [svn] - fix other plugins dependant on the playlist framework
nenolod
parents: 355
diff changeset
466 playlist_add_url(playlist_get_active(), _buf);
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
467 }
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
468 result = -1;
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
469 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
470 }
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
471 }
382
66e09ad0944e [svn] - really fix HES/other multitrack this time
nenolod
parents: 381
diff changeset
472 else if (fh.track_specified)
66e09ad0944e [svn] - really fix HES/other multitrack this time
nenolod
parents: 381
diff changeset
473 {
66e09ad0944e [svn] - really fix HES/other multitrack this time
nenolod
parents: 381
diff changeset
474 result = 1;
66e09ad0944e [svn] - really fix HES/other multitrack this time
nenolod
parents: 381
diff changeset
475 }
66e09ad0944e [svn] - really fix HES/other multitrack this time
nenolod
parents: 381
diff changeset
476
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
477 return result;
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
478 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
479
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
480 // Setup
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
481
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
482 static void console_init(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
483 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
484 console_cfg_load();
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
485 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
486
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
487 extern "C" void console_aboutbox(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
488 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
489 static GtkWidget * aboutbox = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
490
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
491 if (!aboutbox)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
492 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
493 aboutbox = xmms_show_message(_("About the Console Music Decoder"),
341
986f098da058 [svn] - merge in blargg's changes
nenolod
parents: 332
diff changeset
494 _("Console music decoder engine based on Game_Music_Emu 0.5.2.\n"
355
92848bda520d [svn] Move supported formats to plugin info, rename plugin to 'Game console audio module decoder'.
kiyoshi
parents: 341
diff changeset
495 "Supported formats: AY, GBS, GYM, HES, KSS, NSF, NSFE, SAP, SPC, VGM, VGZ\n"
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
496 "Audacious implementation by: William Pitcock <nenolod@nenolod.net>, \n"
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
497 " Shay Green <gblargg@gmail.com>"),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
498 _("Ok"),
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
499 FALSE, NULL, NULL);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
500 gtk_signal_connect(GTK_OBJECT(aboutbox), "destroy",
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
501 (GCallback)gtk_widget_destroyed, &aboutbox);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
502 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
503 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
504
1044
b1128efde471 [svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents: 752
diff changeset
505 const gchar *gme_fmts[] = { "ay", "gbs", "gym", "hes", "kss", "nsf", "nsfe",
378
899e285f4be5 [svn] - extension assist for libconsole
nenolod
parents: 363
diff changeset
506 "sap", "spc", "vgm", "vgz", NULL };
899e285f4be5 [svn] - extension assist for libconsole
nenolod
parents: 363
diff changeset
507
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
508 InputPlugin console_ip =
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
509 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
510 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
511 NULL,
1185
6d749f573b3b suppress warnings.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1184
diff changeset
512 (gchar *)"Game console audio module decoder",
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
513 console_init,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
514 console_aboutbox,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
515 console_cfg_ui,
332
626f9f4d79a8 [svn] Remove old-style is_our_file() where a new-style is_our_fd() exists
kiyoshi
parents: 324
diff changeset
516 NULL,
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
517 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
518 play_file,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
519 console_stop,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
520 console_pause,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
521 seek,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
522 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
523 get_time,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
524 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
525 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
526 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
527 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
528 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
529 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
530 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
531 get_song_info,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
532 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
533 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
534 get_song_tuple,
316
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
535 NULL,
fb513e10174e [svn] - merge libconsole-blargg into mainline libconsole:
nenolod
parents: 12
diff changeset
536 NULL,
378
899e285f4be5 [svn] - extension assist for libconsole
nenolod
parents: 363
diff changeset
537 is_our_file_from_vfs,
1044
b1128efde471 [svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents: 752
diff changeset
538 (gchar **)gme_fmts
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
539 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
540
1069
f04f4a223f7b [svn] - update libconsole to plugin API v2
nenolod
parents: 1044
diff changeset
541 InputPlugin *console_iplist[] = { &console_ip, NULL };
f04f4a223f7b [svn] - update libconsole to plugin API v2
nenolod
parents: 1044
diff changeset
542
f04f4a223f7b [svn] - update libconsole to plugin API v2
nenolod
parents: 1044
diff changeset
543 extern "C" {
f04f4a223f7b [svn] - update libconsole to plugin API v2
nenolod
parents: 1044
diff changeset
544
1395
761e17b23e0c added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 1348
diff changeset
545 DECLARE_PLUGIN(console, NULL, NULL, console_iplist, NULL, NULL, NULL, NULL,NULL);
1069
f04f4a223f7b [svn] - update libconsole to plugin API v2
nenolod
parents: 1044
diff changeset
546
f04f4a223f7b [svn] - update libconsole to plugin API v2
nenolod
parents: 1044
diff changeset
547 };