Commit a0b26823 authored by Monty Montgomery's avatar Monty Montgomery

Add libao support to Postfish (requires libao 1.2, which is not yet released)

Does automatic device discovery for OSS, ALSA and Pulse



git-svn-id: https://svn.xiph.org/trunk/postfish@18782 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 7d045f97
......@@ -37,7 +37,7 @@ OBJ = main.o mainpanel.o multibar.o readout.o input.o output.o clippanel.o \
limit.o limitpanel.o mute.o mixpanel.o mix.o freeverb.o reverbpanel.o \
outpanel.o config.o window.o follower.o linkage.o
GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0`
GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0 ao \> 1.2`
all:
$(MAKE) target CFLAGS="-O2 -ffast-math -fomit-frame-pointer $(GCF) $(ADD_DEF)"
......@@ -46,7 +46,7 @@ debug:
$(MAKE) target CFLAGS="-g -Wall -W -Wno-unused-parameter -D__NO_MATH_INLINES $(GCF) $(ADD_DEF)"
profile:
$(MAKE) target CFLAGS="-pg -g -O2 -ffast-math $(GCF) $(ADD_DEF)" LIBS="-lgprof-helper "
$(MAKE) target CFLAGS="-pg -g -O2 -ffast-math $(GCF) $(ADD_DEF)"
clean:
rm -f $(OBJ) *.d *.d.* gmon.out postfish
......@@ -76,7 +76,7 @@ endif
target: $(OBJ) postfish-wisdomrc
./touch-version
$(LD) $(OBJ) $(CFLAGS) -o postfish $(LIBS) `pkg-config --libs gtk+-2.0` -lpthread -lfftw3f -lm
$(LD) $(OBJ) $(CFLAGS) -o postfish $(LIBS) `pkg-config --libs gtk+-2.0 ao \> 1.2` -lpthread -lfftw3f -lm
install: target
$(INSTALL) -d -m 0755 $(BINDIR)
......
......@@ -248,7 +248,7 @@ void config_save(char *filename){
configentry *c=config_list+i;
if(c->string)
fprintf(f,"(%s bank%d A%d B%d C%d l%d \"%s\" )\n",
c->key,c->bank,c->A,c->B,c->C,strlen(c->string),c->string);
c->key,c->bank,c->A,c->B,c->C,(int)strlen(c->string),c->string);
if(c->vec){
fprintf(f,"[%s bank%d A%d B%d C%d v%d ",
c->key,c->bank,c->A,c->B,c->C,c->vals);
......
......@@ -26,13 +26,13 @@
reusable code. It's monolithic, inflexible, and designed that way
on purpose. */
/* sound playback code is OSS-specific for now */
#include "postfish.h"
#include <signal.h>
#include <getopt.h>
#include <fenv.h> // Thank you C99!
#include <fftw3.h>
#include <gtk/gtk.h>
#include <ao/ao.h>
#include "input.h"
#include "output.h"
#include "declip.h"
......@@ -76,6 +76,7 @@ void clean_exit(int sig){
main_looping=0;
gtk_main_quit();
}
ao_shutdown();
exit(0);
}
......@@ -331,6 +332,7 @@ int main(int argc, char **argv){
}
/* probe outputs */
ao_initialize();
if(setvbuf(stdout, NULL, _IONBF , 0))
fprintf(stderr,"Unable to remove block buffering on stdout; continuing\n");
......@@ -338,10 +340,16 @@ int main(int argc, char **argv){
if(!batch) output_probe_monitor();
/* open all the input files */
if(input_load())exit(1);
if(input_load()){
ao_shutdown();
exit(1);
}
/* load config file */
if(config_load(configfile))exit(1);
if(config_load(configfile)){
ao_shutdown();
exit(1);
}
/* set up filter chains */
if(declip_load())exit(1);
......@@ -359,7 +367,7 @@ int main(int argc, char **argv){
if(pipe(eventpipe)){
fprintf(stderr,"Unable to open event pipe:\n"
" %s\n",strerror(errno));
ao_shutdown();
exit(1);
}
......@@ -378,6 +386,7 @@ int main(int argc, char **argv){
}else
mainpanel_go(argc,argv,input_ch);
ao_shutdown();
return(0);
}
......
......@@ -297,7 +297,7 @@ void outpanel_create(postfish_mainpanel *mp,
&state.monitor);
GtkWidget *stdout_panel=outpanel_subpanel(mp,panel,&outset.stdout,
" standard output ",
output_stdout_device,
output_stdout_ao,
output_stdout_available,
&state.stdout);
......
This diff is collapsed.
......@@ -38,13 +38,13 @@ typedef struct {
} output_settings;
typedef struct {
int type;
int driver;
char *name;
char *file;
} output_monitor_entry;
extern int output_stdout_available;
extern int output_stdout_device;
extern int output_stdout_ao;
extern int output_monitor_available;
extern output_monitor_entry *monitor_list;
extern int monitor_entries;
......
#define VERSION "$Id$ "
/* DO NOT EDIT: Automated versioning hack [Wed Aug 1 11:37:36 EDT 2012] */
/* DO NOT EDIT: Automated versioning hack [Tue Jan 22 05:15:23 EST 2013] */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment