36 #define SW_VOLUME_RANGE 40
48 cop->get_volume (l, r);
64 cop->set_volume (l, r);
67 static pthread_mutex_t
mutex = PTHREAD_MUTEX_INITIALIZER;
70 #define LOCK do {pthread_mutex_lock (& mutex); locked = TRUE;} while (0)
71 #define UNLOCK do {locked = FALSE; pthread_mutex_unlock (& mutex);} while (0)
72 #define LOCKED g_return_if_fail (locked)
73 #define LOCKED_RET(a) g_return_val_if_fail (locked, a)
74 #define LOCK_VIS do {vis_runner_lock (); LOCK;} while (0)
75 #define UNLOCK_VIS do {UNLOCK; vis_runner_unlock ();} while (0)
76 #define LOCKED_VIS g_return_if_fail (locked && vis_runner_locked ())
77 #define LOCKED_VIS_RET(a) g_return_val_if_fail (locked && vis_runner_locked (), a)
92 g_return_if_fail (
cop->set_written_time !=
NULL);
94 cop->set_written_time (0);
100 g_return_if_fail (
cop->drain !=
NULL);
177 AUDDBG (
"Replay Gain info:\n");
189 g_return_if_fail (
cop !=
NULL);
200 float factor = powf (10,
get_double (
NULL,
"replay_gain_preamp") / 20);
206 factor *= powf (10, replay_gain_info.
album_gain / 20);
214 factor *= powf (10, replay_gain_info.
track_gain / 20);
224 if (factor < 0.99 || factor > 1.01)
230 float left_factor, right_factor;
239 if (l == 100 && r == 100)
242 left_factor = (l == 0) ? 0 : powf (10, (
float)
SW_VOLUME_RANGE * (l - 100) / 100 / 20);
243 right_factor = (r == 0) ? 0 : powf (10, (
float)
SW_VOLUME_RANGE * (r - 100) / 100 / 20);
247 factors[0] = left_factor;
248 factors[1] = right_factor;
252 for (channel = 0; channel <
channels; channel ++)
253 factors[channel] = MAX (left_factor, right_factor);
271 void * allocated =
NULL;
284 int ready = (
cop->buffer_free !=
NULL) ?
cop->buffer_free () /
286 ready = MIN (ready, samples);
299 else if (
cop->buffer_free !=
NULL)
317 void * allocated =
NULL;
321 float *
new = g_malloc (
sizeof (
float) * samples);
329 float * fdata =
data;
333 if (data != allocated)
345 g_return_if_fail (
cop !=
NULL);
366 g_return_if_fail (
cop !=
NULL);
375 g_return_if_fail (
opened);
383 g_return_if_fail (
cop !=
NULL);
392 g_return_if_fail (
opened);
402 g_return_if_fail (
cop->set_written_time !=
NULL);
404 cop->set_written_time (time);
418 g_return_if_fail (
cop !=
NULL);
433 g_return_val_if_fail (
cop !=
NULL, 0);
473 g_return_if_fail (
opened);
475 cop->flush (
cop->output_time ());
480 g_return_if_fail (
cop !=
NULL);
504 return cop->output_time ();
509 g_return_val_if_fail (
cop !=
NULL, 0);
516 time = MAX (0, time);
525 g_return_val_if_fail (
cop !=
NULL, 0);
534 g_return_if_fail (
cop !=
NULL);
550 g_return_val_if_fail (op !=
NULL && op->init !=
NULL,
TRUE);
555 if (op->cleanup !=
NULL)
590 g_return_val_if_fail (op !=
NULL && op->init !=
NULL,
FALSE);