summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Lithopsian <deadbeef@nartowicz.co.uk>2014-07-06 17:04:02 +0100
committerGravatar Lithopsian <deadbeef@nartowicz.co.uk>2014-07-06 17:04:02 +0100
commit3c8b29056cb4e68067f475ee6653640b199087df (patch)
treeaa9e019475dc3e5183c4c8440ea7c0d8c91ee001 /plugins
parent6cd87a40c3a3da1ff8ecdc0f8b980cec38de84aa (diff)
parentd012d39f4d256d43cd5e2d95a96f4868fbedd464 (diff)
Merge pull request #8 from Alexey-Yakovenko/master
Resync
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ao/eng_dsf/aica.c4
-rw-r--r--plugins/ao/eng_dsf/aicalfo.c4
-rw-r--r--plugins/ao/eng_psf/peops2/adsr.h4
-rw-r--r--plugins/ao/eng_psf/peops2/adsr2.c4
-rw-r--r--plugins/ao/eng_psf/peops2/reverb2.c16
-rw-r--r--plugins/ao/eng_psf/peops2/spu2.c6
-rw-r--r--plugins/ao/eng_psf/psx.c22
-rw-r--r--plugins/ao/eng_qsf/z80.c166
-rw-r--r--plugins/ao/eng_ssf/scsp.c2
-rw-r--r--plugins/ao/eng_ssf/scsplfo.c4
-rw-r--r--plugins/artwork/Makefile.am9
-rw-r--r--plugins/artwork/artwork.c111
-rw-r--r--plugins/converter/converter.c8
-rw-r--r--plugins/converter/convgui.c3
-rw-r--r--plugins/flac/flac.c86
-rw-r--r--plugins/gme/cgme.c2
-rw-r--r--plugins/gtkui/coverart.c40
-rw-r--r--plugins/gtkui/coverart.h3
-rw-r--r--plugins/gtkui/deadbeef.glade4
-rw-r--r--plugins/gtkui/gtkui.c1
-rw-r--r--plugins/gtkui/interface.c4
-rw-r--r--plugins/gtkui/widgets.c3
-rw-r--r--plugins/liboggedit/oggedit_internal.c3
-rw-r--r--plugins/m3u/m3u.c15
-rw-r--r--plugins/oss/oss.c20
-rw-r--r--plugins/shellexecui/callbacks.c1
-rw-r--r--plugins/shellexecui/callbacks.h4
-rw-r--r--plugins/shellexecui/interface.c4
-rw-r--r--plugins/shellexecui/shellexec.glade3
-rw-r--r--plugins/shellexecui/shellexecui.c11
-rw-r--r--plugins/wma/wma_plugin.c26
31 files changed, 411 insertions, 182 deletions
diff --git a/plugins/ao/eng_dsf/aica.c b/plugins/ao/eng_dsf/aica.c
index f504d647..02831699 100644
--- a/plugins/ao/eng_dsf/aica.c
+++ b/plugins/ao/eng_dsf/aica.c
@@ -402,7 +402,7 @@ void InitADPCM(int *PrevSignal, int *PrevQuant)
*PrevQuant=0x7f;
}
-INLINE signed short DecodeADPCM(int *PrevSignal, unsigned char Delta, int *PrevQuant)
+static INLINE signed short DecodeADPCM(int *PrevSignal, unsigned char Delta, int *PrevQuant)
{
int x = *PrevQuant * quant_mul [Delta & 15];
x = *PrevSignal + ((int)(x + ((UINT32)x >> 29)) >> 3);
@@ -957,7 +957,7 @@ void AICA_TimersAddTicks(struct _AICA *AICA, int ticks)
}
}
-INLINE INT32 AICA_UpdateSlot(struct _AICA *AICA, struct _SLOT *slot)
+static INLINE INT32 AICA_UpdateSlot(struct _AICA *AICA, struct _SLOT *slot)
{
INT32 sample, fpart;
int cur_sample; //current sample
diff --git a/plugins/ao/eng_dsf/aicalfo.c b/plugins/ao/eng_dsf/aicalfo.c
index 9af2ae54..cc1ea1cc 100644
--- a/plugins/ao/eng_dsf/aicalfo.c
+++ b/plugins/ao/eng_dsf/aicalfo.c
@@ -103,7 +103,7 @@ void AICALFO_Init(void)
}
}
-signed int INLINE AICAPLFO_Step(struct _LFO *LFO)
+static signed int INLINE AICAPLFO_Step(struct _LFO *LFO)
{
int p;
@@ -116,7 +116,7 @@ signed int INLINE AICAPLFO_Step(struct _LFO *LFO)
return p<<(SHIFT-LFO_SHIFT);
}
-signed int INLINE AICAALFO_Step(struct _LFO *LFO)
+static signed int INLINE AICAALFO_Step(struct _LFO *LFO)
{
int p;
LFO->phase+=LFO->phase_step;
diff --git a/plugins/ao/eng_psf/peops2/adsr.h b/plugins/ao/eng_psf/peops2/adsr.h
index 777a0d84..fc031ef0 100644
--- a/plugins/ao/eng_psf/peops2/adsr.h
+++ b/plugins/ao/eng_psf/peops2/adsr.h
@@ -24,5 +24,5 @@
//
//*************************************************************************//
-INLINE void StartADSR(int ch);
-INLINE int MixADSR(int ch);
+static INLINE void StartADSR(int ch);
+static INLINE int MixADSR(int ch);
diff --git a/plugins/ao/eng_psf/peops2/adsr2.c b/plugins/ao/eng_psf/peops2/adsr2.c
index 470069c6..79af6c03 100644
--- a/plugins/ao/eng_psf/peops2/adsr2.c
+++ b/plugins/ao/eng_psf/peops2/adsr2.c
@@ -66,7 +66,7 @@ void InitADSR(void) // INIT ADSR
////////////////////////////////////////////////////////////////////////
-INLINE void StartADSR(spu2_state_t *spu, int ch) // MIX ADSR
+static INLINE void StartADSR(spu2_state_t *spu, int ch) // MIX ADSR
{
spu->s_chan[ch].ADSRX.lVolume=1; // and init some adsr vars
spu->s_chan[ch].ADSRX.State=0;
@@ -75,7 +75,7 @@ INLINE void StartADSR(spu2_state_t *spu, int ch) // MIX
////////////////////////////////////////////////////////////////////////
-INLINE int MixADSR(spu2_state_t *spu, int ch) // MIX ADSR
+static INLINE int MixADSR(spu2_state_t *spu, int ch) // MIX ADSR
{
if(spu->s_chan[ch].bStop) // should be stopped:
{ // do release
diff --git a/plugins/ao/eng_psf/peops2/reverb2.c b/plugins/ao/eng_psf/peops2/reverb2.c
index ceab8c54..f8a80661 100644
--- a/plugins/ao/eng_psf/peops2/reverb2.c
+++ b/plugins/ao/eng_psf/peops2/reverb2.c
@@ -51,7 +51,7 @@
// START REVERB
////////////////////////////////////////////////////////////////////////
-INLINE void StartREVERB(spu2_state_t *spu, int ch)
+static INLINE void StartREVERB(spu2_state_t *spu, int ch)
{
int core=ch/24;
@@ -66,7 +66,7 @@ INLINE void StartREVERB(spu2_state_t *spu, int ch)
// HELPER FOR NEILL'S REVERB: re-inits our reverb mixing buf
////////////////////////////////////////////////////////////////////////
-INLINE void InitREVERB(spu2_state_t *spu)
+static INLINE void InitREVERB(spu2_state_t *spu)
{
if(spu->iUseReverb==1)
{
@@ -79,7 +79,7 @@ INLINE void InitREVERB(spu2_state_t *spu)
// STORE REVERB
////////////////////////////////////////////////////////////////////////
-INLINE void StoreREVERB(spu2_state_t *spu, int ch,int ns)
+static INLINE void StoreREVERB(spu2_state_t *spu, int ch,int ns)
{
int core=ch/24;
@@ -99,7 +99,7 @@ INLINE void StoreREVERB(spu2_state_t *spu, int ch,int ns)
////////////////////////////////////////////////////////////////////////
-INLINE int g_buffer(spu2_state_t *spu, int iOff,int core) // get_buffer content helper: takes care about wraps
+static INLINE int g_buffer(spu2_state_t *spu, int iOff,int core) // get_buffer content helper: takes care about wraps
{
short * p=(short *)spu->spuMem;
iOff=(iOff)+spu->rvb[core].CurrAddr;
@@ -110,7 +110,7 @@ INLINE int g_buffer(spu2_state_t *spu, int iOff,int core) // g
////////////////////////////////////////////////////////////////////////
-INLINE void s_buffer(spu2_state_t *spu, int iOff,int iVal,int core) // set_buffer content helper: takes care about wraps and clipping
+static INLINE void s_buffer(spu2_state_t *spu, int iOff,int iVal,int core) // set_buffer content helper: takes care about wraps and clipping
{
short * p=(short *)spu->spuMem;
iOff=(iOff)+spu->rvb[core].CurrAddr;
@@ -122,7 +122,7 @@ INLINE void s_buffer(spu2_state_t *spu, int iOff,int iVal,int core) // se
////////////////////////////////////////////////////////////////////////
-INLINE void s_buffer1(spu2_state_t *spu, int iOff,int iVal,int core) // set_buffer (+1 sample) content helper: takes care about wraps and clipping
+static INLINE void s_buffer1(spu2_state_t *spu, int iOff,int iVal,int core) // set_buffer (+1 sample) content helper: takes care about wraps and clipping
{
short * p=(short *)spu->spuMem;
iOff=(iOff)+spu->rvb[core].CurrAddr+1;
@@ -134,7 +134,7 @@ INLINE void s_buffer1(spu2_state_t *spu, int iOff,int iVal,int core) // set
////////////////////////////////////////////////////////////////////////
-INLINE int MixREVERBLeft(spu2_state_t *spu, int ns,int core)
+static INLINE int MixREVERBLeft(spu2_state_t *spu, int ns,int core)
{
if(spu->iUseReverb==1)
{
@@ -221,7 +221,7 @@ INLINE int MixREVERBLeft(spu2_state_t *spu, int ns,int core)
////////////////////////////////////////////////////////////////////////
-INLINE int MixREVERBRight(spu2_state_t *spu, int core)
+static INLINE int MixREVERBRight(spu2_state_t *spu, int core)
{
if(spu->iUseReverb==1) // Neill's reverb:
{
diff --git a/plugins/ao/eng_psf/peops2/spu2.c b/plugins/ao/eng_psf/peops2/spu2.c
index 44546170..32f56ff0 100644
--- a/plugins/ao/eng_psf/peops2/spu2.c
+++ b/plugins/ao/eng_psf/peops2/spu2.c
@@ -170,7 +170,7 @@ const int f[5][2] = { { 0, 0 },
//
-INLINE void InterpolateUp(spu2_state_t *spu, int ch)
+static INLINE void InterpolateUp(spu2_state_t *spu, int ch)
{
if(spu->s_chan[ch].SB[32]==1) // flag == 1? calc step and set flag... and don't change the value in this pass
{
@@ -218,7 +218,7 @@ INLINE void InterpolateUp(spu2_state_t *spu, int ch)
// even easier interpolation on downsampling, also no special filter, again just "Pete's common sense" tm
//
-INLINE void InterpolateDown(spu2_state_t *spu, int ch)
+static INLINE void InterpolateDown(spu2_state_t *spu, int ch)
{
if(spu->s_chan[ch].sinc>=0x20000L) // we would skip at least one val?
{
@@ -244,7 +244,7 @@ INLINE void InterpolateDown(spu2_state_t *spu, int ch)
// START SOUND... called by main thread to setup a new sound on a channel
////////////////////////////////////////////////////////////////////////
-INLINE void StartSound(spu2_state_t *spu, int ch)
+static INLINE void StartSound(spu2_state_t *spu, int ch)
{
spu->dwNewChannel2[ch/24]&=~(1<<(ch%24)); // clear new channel bit
spu->dwEndChannel2[ch/24]&=~(1<<(ch%24)); // clear end channel bit
diff --git a/plugins/ao/eng_psf/psx.c b/plugins/ao/eng_psf/psx.c
index 8f646d05..1a0adda1 100644
--- a/plugins/ao/eng_psf/psx.c
+++ b/plugins/ao/eng_psf/psx.c
@@ -204,7 +204,7 @@ void GTELOG(const char *a,...)
logerror( "%08x: GTE: %08x %s\n", cpu->pc, INS_COFUN( cpu->op ), s_text );
}
#else
-INLINE void GTELOG(const char *a, ...) {}
+static INLINE void GTELOG(const char *a, ...) {}
#endif
static UINT32 getcp2dr( mips_cpu_context *cpu, int n_reg );
@@ -223,7 +223,7 @@ void mips_stop( void )
#endif
}
-INLINE void mips_set_cp0r(mips_cpu_context *cpu, int reg, UINT32 value )
+static INLINE void mips_set_cp0r(mips_cpu_context *cpu, int reg, UINT32 value )
{
cpu->cp0r[ reg ] = value;
if( reg == CP0_SR || reg == CP0_CAUSE )
@@ -240,7 +240,7 @@ INLINE void mips_set_cp0r(mips_cpu_context *cpu, int reg, UINT32 value )
}
}
-INLINE void mips_commit_delayed_load(mips_cpu_context *cpu)
+static INLINE void mips_commit_delayed_load(mips_cpu_context *cpu)
{
if( cpu->delayr != 0 )
{
@@ -250,7 +250,7 @@ INLINE void mips_commit_delayed_load(mips_cpu_context *cpu)
}
}
-INLINE void mips_delayed_branch(mips_cpu_context *cpu, UINT32 n_adr )
+static INLINE void mips_delayed_branch(mips_cpu_context *cpu, UINT32 n_adr )
{
if( ( n_adr & ( ( ( cpu->cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 3 ) ) != 0 )
{
@@ -266,7 +266,7 @@ INLINE void mips_delayed_branch(mips_cpu_context *cpu, UINT32 n_adr )
}
}
-INLINE void mips_set_pc(mips_cpu_context *cpu, unsigned val )
+static INLINE void mips_set_pc(mips_cpu_context *cpu, unsigned val )
{
cpu->pc = val;
change_pc( val );
@@ -274,7 +274,7 @@ INLINE void mips_set_pc(mips_cpu_context *cpu, unsigned val )
cpu->delayv = 0;
}
-INLINE void mips_advance_pc(mips_cpu_context *cpu)
+static INLINE void mips_advance_pc(mips_cpu_context *cpu)
{
if( cpu->delayr == REGPC )
{
@@ -287,7 +287,7 @@ INLINE void mips_advance_pc(mips_cpu_context *cpu)
}
}
-INLINE void mips_load(mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v )
+static INLINE void mips_load(mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v )
{
mips_advance_pc(cpu);
if( n_r != 0 )
@@ -296,7 +296,7 @@ INLINE void mips_load(mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v )
}
}
-INLINE void mips_delayed_load( mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v )
+static INLINE void mips_delayed_load( mips_cpu_context *cpu, UINT32 n_r, UINT32 n_v )
{
if( cpu->delayr == REGPC )
{
@@ -1905,7 +1905,7 @@ static void setcp2cr(mips_cpu_context *cpu, int n_reg, UINT32 n_value )
cpu->cp2cr[ n_reg ].d = n_value;
}
-INLINE INT32 LIM( mips_cpu_context *cpu, INT32 n_value, INT32 n_max, INT32 n_min, UINT32 n_flag )
+static INLINE INT32 LIM( mips_cpu_context *cpu, INT32 n_value, INT32 n_max, INT32 n_min, UINT32 n_flag )
{
if( n_value > n_max )
{
@@ -1920,7 +1920,7 @@ INLINE INT32 LIM( mips_cpu_context *cpu, INT32 n_value, INT32 n_max, INT32 n_min
return n_value;
}
-INLINE INT64 BOUNDS( mips_cpu_context *cpu, INT64 n_value, INT64 n_max, int n_maxflag, INT64 n_min, int n_minflag )
+static INLINE INT64 BOUNDS( mips_cpu_context *cpu, INT64 n_value, INT64 n_max, int n_maxflag, INT64 n_min, int n_minflag )
{
if( n_value > n_max )
{
@@ -1944,7 +1944,7 @@ INLINE INT64 BOUNDS( mips_cpu_context *cpu, INT64 n_value, INT64 n_max, int n_ma
#define Lm_C3( a ) LIM( cpu, ( a ), 0x00ff, 0x0000, ( 1 << 19 ) )
#define Lm_D( a ) LIM( cpu, ( a ), 0xffff, 0x0000, ( 1 << 31 ) | ( 1 << 18 ) )
-INLINE UINT32 Lm_E( mips_cpu_context *cpu, UINT32 n_z )
+static INLINE UINT32 Lm_E( mips_cpu_context *cpu, UINT32 n_z )
{
if( n_z <= H / 2 )
{
diff --git a/plugins/ao/eng_qsf/z80.c b/plugins/ao/eng_qsf/z80.c
index ddcd57ce..91e873a3 100644
--- a/plugins/ao/eng_qsf/z80.c
+++ b/plugins/ao/eng_qsf/z80.c
@@ -277,70 +277,70 @@ static void take_interrupt(z80_state_t *z80);
typedef void (*funcptr)(z80_state_t *z80);
#define PROTOTYPES(tablename,prefix) \
- INLINE void prefix##_00(z80_state_t *z80); INLINE void prefix##_01(z80_state_t *z80); INLINE void prefix##_02(z80_state_t *z80); INLINE void prefix##_03(z80_state_t *z80); \
- INLINE void prefix##_04(z80_state_t *z80); INLINE void prefix##_05(z80_state_t *z80); INLINE void prefix##_06(z80_state_t *z80); INLINE void prefix##_07(z80_state_t *z80); \
- INLINE void prefix##_08(z80_state_t *z80); INLINE void prefix##_09(z80_state_t *z80); INLINE void prefix##_0a(z80_state_t *z80); INLINE void prefix##_0b(z80_state_t *z80); \
- INLINE void prefix##_0c(z80_state_t *z80); INLINE void prefix##_0d(z80_state_t *z80); INLINE void prefix##_0e(z80_state_t *z80); INLINE void prefix##_0f(z80_state_t *z80); \
- INLINE void prefix##_10(z80_state_t *z80); INLINE void prefix##_11(z80_state_t *z80); INLINE void prefix##_12(z80_state_t *z80); INLINE void prefix##_13(z80_state_t *z80); \
- INLINE void prefix##_14(z80_state_t *z80); INLINE void prefix##_15(z80_state_t *z80); INLINE void prefix##_16(z80_state_t *z80); INLINE void prefix##_17(z80_state_t *z80); \
- INLINE void prefix##_18(z80_state_t *z80); INLINE void prefix##_19(z80_state_t *z80); INLINE void prefix##_1a(z80_state_t *z80); INLINE void prefix##_1b(z80_state_t *z80); \
- INLINE void prefix##_1c(z80_state_t *z80); INLINE void prefix##_1d(z80_state_t *z80); INLINE void prefix##_1e(z80_state_t *z80); INLINE void prefix##_1f(z80_state_t *z80); \
- INLINE void prefix##_20(z80_state_t *z80); INLINE void prefix##_21(z80_state_t *z80); INLINE void prefix##_22(z80_state_t *z80); INLINE void prefix##_23(z80_state_t *z80); \
- INLINE void prefix##_24(z80_state_t *z80); INLINE void prefix##_25(z80_state_t *z80); INLINE void prefix##_26(z80_state_t *z80); INLINE void prefix##_27(z80_state_t *z80); \
- INLINE void prefix##_28(z80_state_t *z80); INLINE void prefix##_29(z80_state_t *z80); INLINE void prefix##_2a(z80_state_t *z80); INLINE void prefix##_2b(z80_state_t *z80); \
- INLINE void prefix##_2c(z80_state_t *z80); INLINE void prefix##_2d(z80_state_t *z80); INLINE void prefix##_2e(z80_state_t *z80); INLINE void prefix##_2f(z80_state_t *z80); \
- INLINE void prefix##_30(z80_state_t *z80); INLINE void prefix##_31(z80_state_t *z80); INLINE void prefix##_32(z80_state_t *z80); INLINE void prefix##_33(z80_state_t *z80); \
- INLINE void prefix##_34(z80_state_t *z80); INLINE void prefix##_35(z80_state_t *z80); INLINE void prefix##_36(z80_state_t *z80); INLINE void prefix##_37(z80_state_t *z80); \
- INLINE void prefix##_38(z80_state_t *z80); INLINE void prefix##_39(z80_state_t *z80); INLINE void prefix##_3a(z80_state_t *z80); INLINE void prefix##_3b(z80_state_t *z80); \
- INLINE void prefix##_3c(z80_state_t *z80); INLINE void prefix##_3d(z80_state_t *z80); INLINE void prefix##_3e(z80_state_t *z80); INLINE void prefix##_3f(z80_state_t *z80); \
- INLINE void prefix##_40(z80_state_t *z80); INLINE void prefix##_41(z80_state_t *z80); INLINE void prefix##_42(z80_state_t *z80); INLINE void prefix##_43(z80_state_t *z80); \
- INLINE void prefix##_44(z80_state_t *z80); INLINE void prefix##_45(z80_state_t *z80); INLINE void prefix##_46(z80_state_t *z80); INLINE void prefix##_47(z80_state_t *z80); \
- INLINE void prefix##_48(z80_state_t *z80); INLINE void prefix##_49(z80_state_t *z80); INLINE void prefix##_4a(z80_state_t *z80); INLINE void prefix##_4b(z80_state_t *z80); \
- INLINE void prefix##_4c(z80_state_t *z80); INLINE void prefix##_4d(z80_state_t *z80); INLINE void prefix##_4e(z80_state_t *z80); INLINE void prefix##_4f(z80_state_t *z80); \
- INLINE void prefix##_50(z80_state_t *z80); INLINE void prefix##_51(z80_state_t *z80); INLINE void prefix##_52(z80_state_t *z80); INLINE void prefix##_53(z80_state_t *z80); \
- INLINE void prefix##_54(z80_state_t *z80); INLINE void prefix##_55(z80_state_t *z80); INLINE void prefix##_56(z80_state_t *z80); INLINE void prefix##_57(z80_state_t *z80); \
- INLINE void prefix##_58(z80_state_t *z80); INLINE void prefix##_59(z80_state_t *z80); INLINE void prefix##_5a(z80_state_t *z80); INLINE void prefix##_5b(z80_state_t *z80); \
- INLINE void prefix##_5c(z80_state_t *z80); INLINE void prefix##_5d(z80_state_t *z80); INLINE void prefix##_5e(z80_state_t *z80); INLINE void prefix##_5f(z80_state_t *z80); \
- INLINE void prefix##_60(z80_state_t *z80); INLINE void prefix##_61(z80_state_t *z80); INLINE void prefix##_62(z80_state_t *z80); INLINE void prefix##_63(z80_state_t *z80); \
- INLINE void prefix##_64(z80_state_t *z80); INLINE void prefix##_65(z80_state_t *z80); INLINE void prefix##_66(z80_state_t *z80); INLINE void prefix##_67(z80_state_t *z80); \
- INLINE void prefix##_68(z80_state_t *z80); INLINE void prefix##_69(z80_state_t *z80); INLINE void prefix##_6a(z80_state_t *z80); INLINE void prefix##_6b(z80_state_t *z80); \
- INLINE void prefix##_6c(z80_state_t *z80); INLINE void prefix##_6d(z80_state_t *z80); INLINE void prefix##_6e(z80_state_t *z80); INLINE void prefix##_6f(z80_state_t *z80); \
- INLINE void prefix##_70(z80_state_t *z80); INLINE void prefix##_71(z80_state_t *z80); INLINE void prefix##_72(z80_state_t *z80); INLINE void prefix##_73(z80_state_t *z80); \
- INLINE void prefix##_74(z80_state_t *z80); INLINE void prefix##_75(z80_state_t *z80); INLINE void prefix##_76(z80_state_t *z80); INLINE void prefix##_77(z80_state_t *z80); \
- INLINE void prefix##_78(z80_state_t *z80); INLINE void prefix##_79(z80_state_t *z80); INLINE void prefix##_7a(z80_state_t *z80); INLINE void prefix##_7b(z80_state_t *z80); \
- INLINE void prefix##_7c(z80_state_t *z80); INLINE void prefix##_7d(z80_state_t *z80); INLINE void prefix##_7e(z80_state_t *z80); INLINE void prefix##_7f(z80_state_t *z80); \
- INLINE void prefix##_80(z80_state_t *z80); INLINE void prefix##_81(z80_state_t *z80); INLINE void prefix##_82(z80_state_t *z80); INLINE void prefix##_83(z80_state_t *z80); \
- INLINE void prefix##_84(z80_state_t *z80); INLINE void prefix##_85(z80_state_t *z80); INLINE void prefix##_86(z80_state_t *z80); INLINE void prefix##_87(z80_state_t *z80); \
- INLINE void prefix##_88(z80_state_t *z80); INLINE void prefix##_89(z80_state_t *z80); INLINE void prefix##_8a(z80_state_t *z80); INLINE void prefix##_8b(z80_state_t *z80); \
- INLINE void prefix##_8c(z80_state_t *z80); INLINE void prefix##_8d(z80_state_t *z80); INLINE void prefix##_8e(z80_state_t *z80); INLINE void prefix##_8f(z80_state_t *z80); \
- INLINE void prefix##_90(z80_state_t *z80); INLINE void prefix##_91(z80_state_t *z80); INLINE void prefix##_92(z80_state_t *z80); INLINE void prefix##_93(z80_state_t *z80); \
- INLINE void prefix##_94(z80_state_t *z80); INLINE void prefix##_95(z80_state_t *z80); INLINE void prefix##_96(z80_state_t *z80); INLINE void prefix##_97(z80_state_t *z80); \
- INLINE void prefix##_98(z80_state_t *z80); INLINE void prefix##_99(z80_state_t *z80); INLINE void prefix##_9a(z80_state_t *z80); INLINE void prefix##_9b(z80_state_t *z80); \
- INLINE void prefix##_9c(z80_state_t *z80); INLINE void prefix##_9d(z80_state_t *z80); INLINE void prefix##_9e(z80_state_t *z80); INLINE void prefix##_9f(z80_state_t *z80); \
- INLINE void prefix##_a0(z80_state_t *z80); INLINE void prefix##_a1(z80_state_t *z80); INLINE void prefix##_a2(z80_state_t *z80); INLINE void prefix##_a3(z80_state_t *z80); \
- INLINE void prefix##_a4(z80_state_t *z80); INLINE void prefix##_a5(z80_state_t *z80); INLINE void prefix##_a6(z80_state_t *z80); INLINE void prefix##_a7(z80_state_t *z80); \
- INLINE void prefix##_a8(z80_state_t *z80); INLINE void prefix##_a9(z80_state_t *z80); INLINE void prefix##_aa(z80_state_t *z80); INLINE void prefix##_ab(z80_state_t *z80); \
- INLINE void prefix##_ac(z80_state_t *z80); INLINE void prefix##_ad(z80_state_t *z80); INLINE void prefix##_ae(z80_state_t *z80); INLINE void prefix##_af(z80_state_t *z80); \
- INLINE void prefix##_b0(z80_state_t *z80); INLINE void prefix##_b1(z80_state_t *z80); INLINE void prefix##_b2(z80_state_t *z80); INLINE void prefix##_b3(z80_state_t *z80); \
- INLINE void prefix##_b4(z80_state_t *z80); INLINE void prefix##_b5(z80_state_t *z80); INLINE void prefix##_b6(z80_state_t *z80); INLINE void prefix##_b7(z80_state_t *z80); \
- INLINE void prefix##_b8(z80_state_t *z80); INLINE void prefix##_b9(z80_state_t *z80); INLINE void prefix##_ba(z80_state_t *z80); INLINE void prefix##_bb(z80_state_t *z80); \
- INLINE void prefix##_bc(z80_state_t *z80); INLINE void prefix##_bd(z80_state_t *z80); INLINE void prefix##_be(z80_state_t *z80); INLINE void prefix##_bf(z80_state_t *z80); \
- INLINE void prefix##_c0(z80_state_t *z80); INLINE void prefix##_c1(z80_state_t *z80); INLINE void prefix##_c2(z80_state_t *z80); INLINE void prefix##_c3(z80_state_t *z80); \
- INLINE void prefix##_c4(z80_state_t *z80); INLINE void prefix##_c5(z80_state_t *z80); INLINE void prefix##_c6(z80_state_t *z80); INLINE void prefix##_c7(z80_state_t *z80); \
- INLINE void prefix##_c8(z80_state_t *z80); INLINE void prefix##_c9(z80_state_t *z80); INLINE void prefix##_ca(z80_state_t *z80); INLINE void prefix##_cb(z80_state_t *z80); \
- INLINE void prefix##_cc(z80_state_t *z80); INLINE void prefix##_cd(z80_state_t *z80); INLINE void prefix##_ce(z80_state_t *z80); INLINE void prefix##_cf(z80_state_t *z80); \
- INLINE void prefix##_d0(z80_state_t *z80); INLINE void prefix##_d1(z80_state_t *z80); INLINE void prefix##_d2(z80_state_t *z80); INLINE void prefix##_d3(z80_state_t *z80); \
- INLINE void prefix##_d4(z80_state_t *z80); INLINE void prefix##_d5(z80_state_t *z80); INLINE void prefix##_d6(z80_state_t *z80); INLINE void prefix##_d7(z80_state_t *z80); \
- INLINE void prefix##_d8(z80_state_t *z80); INLINE void prefix##_d9(z80_state_t *z80); INLINE void prefix##_da(z80_state_t *z80); INLINE void prefix##_db(z80_state_t *z80); \
- INLINE void prefix##_dc(z80_state_t *z80); INLINE void prefix##_dd(z80_state_t *z80); INLINE void prefix##_de(z80_state_t *z80); INLINE void prefix##_df(z80_state_t *z80); \
- INLINE void prefix##_e0(z80_state_t *z80); INLINE void prefix##_e1(z80_state_t *z80); INLINE void prefix##_e2(z80_state_t *z80); INLINE void prefix##_e3(z80_state_t *z80); \
- INLINE void prefix##_e4(z80_state_t *z80); INLINE void prefix##_e5(z80_state_t *z80); INLINE void prefix##_e6(z80_state_t *z80); INLINE void prefix##_e7(z80_state_t *z80); \
- INLINE void prefix##_e8(z80_state_t *z80); INLINE void prefix##_e9(z80_state_t *z80); INLINE void prefix##_ea(z80_state_t *z80); INLINE void prefix##_eb(z80_state_t *z80); \
- INLINE void prefix##_ec(z80_state_t *z80); INLINE void prefix##_ed(z80_state_t *z80); INLINE void prefix##_ee(z80_state_t *z80); INLINE void prefix##_ef(z80_state_t *z80); \
- INLINE void prefix##_f0(z80_state_t *z80); INLINE void prefix##_f1(z80_state_t *z80); INLINE void prefix##_f2(z80_state_t *z80); INLINE void prefix##_f3(z80_state_t *z80); \
- INLINE void prefix##_f4(z80_state_t *z80); INLINE void prefix##_f5(z80_state_t *z80); INLINE void prefix##_f6(z80_state_t *z80); INLINE void prefix##_f7(z80_state_t *z80); \
- INLINE void prefix##_f8(z80_state_t *z80); INLINE void prefix##_f9(z80_state_t *z80); INLINE void prefix##_fa(z80_state_t *z80); INLINE void prefix##_fb(z80_state_t *z80); \
- INLINE void prefix##_fc(z80_state_t *z80); INLINE void prefix##_fd(z80_state_t *z80); INLINE void prefix##_fe(z80_state_t *z80); INLINE void prefix##_ff(z80_state_t *z80); \
+ static INLINE void prefix##_00(z80_state_t *z80); static INLINE void prefix##_01(z80_state_t *z80); static INLINE void prefix##_02(z80_state_t *z80); static INLINE void prefix##_03(z80_state_t *z80); \
+ static INLINE void prefix##_04(z80_state_t *z80); static INLINE void prefix##_05(z80_state_t *z80); static INLINE void prefix##_06(z80_state_t *z80); static INLINE void prefix##_07(z80_state_t *z80); \
+ static INLINE void prefix##_08(z80_state_t *z80); static INLINE void prefix##_09(z80_state_t *z80); static INLINE void prefix##_0a(z80_state_t *z80); static INLINE void prefix##_0b(z80_state_t *z80); \
+ static INLINE void prefix##_0c(z80_state_t *z80); static INLINE void prefix##_0d(z80_state_t *z80); static INLINE void prefix##_0e(z80_state_t *z80); static INLINE void prefix##_0f(z80_state_t *z80); \
+ static INLINE void prefix##_10(z80_state_t *z80); static INLINE void prefix##_11(z80_state_t *z80); static INLINE void prefix##_12(z80_state_t *z80); static INLINE void prefix##_13(z80_state_t *z80); \
+ static INLINE void prefix##_14(z80_state_t *z80); static INLINE void prefix##_15(z80_state_t *z80); static INLINE void prefix##_16(z80_state_t *z80); static INLINE void prefix##_17(z80_state_t *z80); \
+ static INLINE void prefix##_18(z80_state_t *z80); static INLINE void prefix##_19(z80_state_t *z80); static INLINE void prefix##_1a(z80_state_t *z80); static INLINE void prefix##_1b(z80_state_t *z80); \
+ static INLINE void prefix##_1c(z80_state_t *z80); static INLINE void prefix##_1d(z80_state_t *z80); static INLINE void prefix##_1e(z80_state_t *z80); static INLINE void prefix##_1f(z80_state_t *z80); \
+ static INLINE void prefix##_20(z80_state_t *z80); static INLINE void prefix##_21(z80_state_t *z80); static INLINE void prefix##_22(z80_state_t *z80); static INLINE void prefix##_23(z80_state_t *z80); \
+ static INLINE void prefix##_24(z80_state_t *z80); static INLINE void prefix##_25(z80_state_t *z80); static INLINE void prefix##_26(z80_state_t *z80); static INLINE void prefix##_27(z80_state_t *z80); \
+ static INLINE void prefix##_28(z80_state_t *z80); static INLINE void prefix##_29(z80_state_t *z80); static INLINE void prefix##_2a(z80_state_t *z80); static INLINE void prefix##_2b(z80_state_t *z80); \
+ static INLINE void prefix##_2c(z80_state_t *z80); static INLINE void prefix##_2d(z80_state_t *z80); static INLINE void prefix##_2e(z80_state_t *z80); static INLINE void prefix##_2f(z80_state_t *z80); \
+ static INLINE void prefix##_30(z80_state_t *z80); static INLINE void prefix##_31(z80_state_t *z80); static INLINE void prefix##_32(z80_state_t *z80); static INLINE void prefix##_33(z80_state_t *z80); \
+ static INLINE void prefix##_34(z80_state_t *z80); static INLINE void prefix##_35(z80_state_t *z80); static INLINE void prefix##_36(z80_state_t *z80); static INLINE void prefix##_37(z80_state_t *z80); \
+ static INLINE void prefix##_38(z80_state_t *z80); static INLINE void prefix##_39(z80_state_t *z80); static INLINE void prefix##_3a(z80_state_t *z80); static INLINE void prefix##_3b(z80_state_t *z80); \
+ static INLINE void prefix##_3c(z80_state_t *z80); static INLINE void prefix##_3d(z80_state_t *z80); static INLINE void prefix##_3e(z80_state_t *z80); static INLINE void prefix##_3f(z80_state_t *z80); \
+ static INLINE void prefix##_40(z80_state_t *z80); static INLINE void prefix##_41(z80_state_t *z80); static INLINE void prefix##_42(z80_state_t *z80); static INLINE void prefix##_43(z80_state_t *z80); \
+ static INLINE void prefix##_44(z80_state_t *z80); static INLINE void prefix##_45(z80_state_t *z80); static INLINE void prefix##_46(z80_state_t *z80); static INLINE void prefix##_47(z80_state_t *z80); \
+ static INLINE void prefix##_48(z80_state_t *z80); static INLINE void prefix##_49(z80_state_t *z80); static INLINE void prefix##_4a(z80_state_t *z80); static INLINE void prefix##_4b(z80_state_t *z80); \
+ static INLINE void prefix##_4c(z80_state_t *z80); static INLINE void prefix##_4d(z80_state_t *z80); static INLINE void prefix##_4e(z80_state_t *z80); static INLINE void prefix##_4f(z80_state_t *z80); \
+ static INLINE void prefix##_50(z80_state_t *z80); static INLINE void prefix##_51(z80_state_t *z80); static INLINE void prefix##_52(z80_state_t *z80); static INLINE void prefix##_53(z80_state_t *z80); \
+ static INLINE void prefix##_54(z80_state_t *z80); static INLINE void prefix##_55(z80_state_t *z80); static INLINE void prefix##_56(z80_state_t *z80); static INLINE void prefix##_57(z80_state_t *z80); \
+ static INLINE void prefix##_58(z80_state_t *z80); static INLINE void prefix##_59(z80_state_t *z80); static INLINE void prefix##_5a(z80_state_t *z80); static INLINE void prefix##_5b(z80_state_t *z80); \
+ static INLINE void prefix##_5c(z80_state_t *z80); static INLINE void prefix##_5d(z80_state_t *z80); static INLINE void prefix##_5e(z80_state_t *z80); static INLINE void prefix##_5f(z80_state_t *z80); \
+ static INLINE void prefix##_60(z80_state_t *z80); static INLINE void prefix##_61(z80_state_t *z80); static INLINE void prefix##_62(z80_state_t *z80); static INLINE void prefix##_63(z80_state_t *z80); \
+ static INLINE void prefix##_64(z80_state_t *z80); static INLINE void prefix##_65(z80_state_t *z80); static INLINE void prefix##_66(z80_state_t *z80); static INLINE void prefix##_67(z80_state_t *z80); \
+ static INLINE void prefix##_68(z80_state_t *z80); static INLINE void prefix##_69(z80_state_t *z80); static INLINE void prefix##_6a(z80_state_t *z80); static INLINE void prefix##_6b(z80_state_t *z80); \
+ static INLINE void prefix##_6c(z80_state_t *z80); static INLINE void prefix##_6d(z80_state_t *z80); static INLINE void prefix##_6e(z80_state_t *z80); static INLINE void prefix##_6f(z80_state_t *z80); \
+ static INLINE void prefix##_70(z80_state_t *z80); static INLINE void prefix##_71(z80_state_t *z80); static INLINE void prefix##_72(z80_state_t *z80); static INLINE void prefix##_73(z80_state_t *z80); \
+ static INLINE void prefix##_74(z80_state_t *z80); static INLINE void prefix##_75(z80_state_t *z80); static INLINE void prefix##_76(z80_state_t *z80); static INLINE void prefix##_77(z80_state_t *z80); \
+ static INLINE void prefix##_78(z80_state_t *z80); static INLINE void prefix##_79(z80_state_t *z80); static INLINE void prefix##_7a(z80_state_t *z80); static INLINE void prefix##_7b(z80_state_t *z80); \
+ static INLINE void prefix##_7c(z80_state_t *z80); static INLINE void prefix##_7d(z80_state_t *z80); static INLINE void prefix##_7e(z80_state_t *z80); static INLINE void prefix##_7f(z80_state_t *z80); \
+ static INLINE void prefix##_80(z80_state_t *z80); static INLINE void prefix##_81(z80_state_t *z80); static INLINE void prefix##_82(z80_state_t *z80); static INLINE void prefix##_83(z80_state_t *z80); \
+ static INLINE void prefix##_84(z80_state_t *z80); static INLINE void prefix##_85(z80_state_t *z80); static INLINE void prefix##_86(z80_state_t *z80); static INLINE void prefix##_87(z80_state_t *z80); \
+ static INLINE void prefix##_88(z80_state_t *z80); static INLINE void prefix##_89(z80_state_t *z80); static INLINE void prefix##_8a(z80_state_t *z80); static INLINE void prefix##_8b(z80_state_t *z80); \
+ static INLINE void prefix##_8c(z80_state_t *z80); static INLINE void prefix##_8d(z80_state_t *z80); static INLINE void prefix##_8e(z80_state_t *z80); static INLINE void prefix##_8f(z80_state_t *z80); \
+ static INLINE void prefix##_90(z80_state_t *z80); static INLINE void prefix##_91(z80_state_t *z80); static INLINE void prefix##_92(z80_state_t *z80); static INLINE void prefix##_93(z80_state_t *z80); \
+ static INLINE void prefix##_94(z80_state_t *z80); static INLINE void prefix##_95(z80_state_t *z80); static INLINE void prefix##_96(z80_state_t *z80); static INLINE void prefix##_97(z80_state_t *z80); \
+ static INLINE void prefix##_98(z80_state_t *z80); static INLINE void prefix##_99(z80_state_t *z80); static INLINE void prefix##_9a(z80_state_t *z80); static INLINE void prefix##_9b(z80_state_t *z80); \
+ static INLINE void prefix##_9c(z80_state_t *z80); static INLINE void prefix##_9d(z80_state_t *z80); static INLINE void prefix##_9e(z80_state_t *z80); static INLINE void prefix##_9f(z80_state_t *z80); \
+ static INLINE void prefix##_a0(z80_state_t *z80); static INLINE void prefix##_a1(z80_state_t *z80); static INLINE void prefix##_a2(z80_state_t *z80); static INLINE void prefix##_a3(z80_state_t *z80); \
+ static INLINE void prefix##_a4(z80_state_t *z80); static INLINE void prefix##_a5(z80_state_t *z80); static INLINE void prefix##_a6(z80_state_t *z80); static INLINE void prefix##_a7(z80_state_t *z80); \
+ static INLINE void prefix##_a8(z80_state_t *z80); static INLINE void prefix##_a9(z80_state_t *z80); static INLINE void prefix##_aa(z80_state_t *z80); static INLINE void prefix##_ab(z80_state_t *z80); \
+ static INLINE void prefix##_ac(z80_state_t *z80); static INLINE void prefix##_ad(z80_state_t *z80); static INLINE void prefix##_ae(z80_state_t *z80); static INLINE void prefix##_af(z80_state_t *z80); \
+ static INLINE void prefix##_b0(z80_state_t *z80); static INLINE void prefix##_b1(z80_state_t *z80); static INLINE void prefix##_b2(z80_state_t *z80); static INLINE void prefix##_b3(z80_state_t *z80); \
+ static INLINE void prefix##_b4(z80_state_t *z80); static INLINE void prefix##_b5(z80_state_t *z80); static INLINE void prefix##_b6(z80_state_t *z80); static INLINE void prefix##_b7(z80_state_t *z80); \
+ static INLINE void prefix##_b8(z80_state_t *z80); static INLINE void prefix##_b9(z80_state_t *z80); static INLINE void prefix##_ba(z80_state_t *z80); static INLINE void prefix##_bb(z80_state_t *z80); \
+ static INLINE void prefix##_bc(z80_state_t *z80); static INLINE void prefix##_bd(z80_state_t *z80); static INLINE void prefix##_be(z80_state_t *z80); static INLINE void prefix##_bf(z80_state_t *z80); \
+ static INLINE void prefix##_c0(z80_state_t *z80); static INLINE void prefix##_c1(z80_state_t *z80); static INLINE void prefix##_c2(z80_state_t *z80); static INLINE void prefix##_c3(z80_state_t *z80); \
+ static INLINE void prefix##_c4(z80_state_t *z80); static INLINE void prefix##_c5(z80_state_t *z80); static INLINE void prefix##_c6(z80_state_t *z80); static INLINE void prefix##_c7(z80_state_t *z80); \
+ static INLINE void prefix##_c8(z80_state_t *z80); static INLINE void prefix##_c9(z80_state_t *z80); static INLINE void prefix##_ca(z80_state_t *z80); static INLINE void prefix##_cb(z80_state_t *z80); \
+ static INLINE void prefix##_cc(z80_state_t *z80); static INLINE void prefix##_cd(z80_state_t *z80); static INLINE void prefix##_ce(z80_state_t *z80); static INLINE void prefix##_cf(z80_state_t *z80); \
+ static INLINE void prefix##_d0(z80_state_t *z80); static INLINE void prefix##_d1(z80_state_t *z80); static INLINE void prefix##_d2(z80_state_t *z80); static INLINE void prefix##_d3(z80_state_t *z80); \
+ static INLINE void prefix##_d4(z80_state_t *z80); static INLINE void prefix##_d5(z80_state_t *z80); static INLINE void prefix##_d6(z80_state_t *z80); static INLINE void prefix##_d7(z80_state_t *z80); \
+ static INLINE void prefix##_d8(z80_state_t *z80); static INLINE void prefix##_d9(z80_state_t *z80); static INLINE void prefix##_da(z80_state_t *z80); static INLINE void prefix##_db(z80_state_t *z80); \
+ static INLINE void prefix##_dc(z80_state_t *z80); static INLINE void prefix##_dd(z80_state_t *z80); static INLINE void prefix##_de(z80_state_t *z80); static INLINE void prefix##_df(z80_state_t *z80); \
+ static INLINE void prefix##_e0(z80_state_t *z80); static INLINE void prefix##_e1(z80_state_t *z80); static INLINE void prefix##_e2(z80_state_t *z80); static INLINE void prefix##_e3(z80_state_t *z80); \
+ static INLINE void prefix##_e4(z80_state_t *z80); static INLINE void prefix##_e5(z80_state_t *z80); static INLINE void prefix##_e6(z80_state_t *z80); static INLINE void prefix##_e7(z80_state_t *z80); \
+ static INLINE void prefix##_e8(z80_state_t *z80); static INLINE void prefix##_e9(z80_state_t *z80); static INLINE void prefix##_ea(z80_state_t *z80); static INLINE void prefix##_eb(z80_state_t *z80); \
+ static INLINE void prefix##_ec(z80_state_t *z80); static INLINE void prefix##_ed(z80_state_t *z80); static INLINE void prefix##_ee(z80_state_t *z80); static INLINE void prefix##_ef(z80_state_t *z80); \
+ static INLINE void prefix##_f0(z80_state_t *z80); static INLINE void prefix##_f1(z80_state_t *z80); static INLINE void prefix##_f2(z80_state_t *z80); static INLINE void prefix##_f3(z80_state_t *z80); \
+ static INLINE void prefix##_f4(z80_state_t *z80); static INLINE void prefix##_f5(z80_state_t *z80); static INLINE void prefix##_f6(z80_state_t *z80); static INLINE void prefix##_f7(z80_state_t *z80); \
+ static INLINE void prefix##_f8(z80_state_t *z80); static INLINE void prefix##_f9(z80_state_t *z80); static INLINE void prefix##_fa(z80_state_t *z80); static INLINE void prefix##_fb(z80_state_t *z80); \
+ static INLINE void prefix##_fc(z80_state_t *z80); static INLINE void prefix##_fd(z80_state_t *z80); static INLINE void prefix##_fe(z80_state_t *z80); static INLINE void prefix##_ff(z80_state_t *z80); \
static const funcptr tablename[0x100] = { \
prefix##_00,prefix##_01,prefix##_02,prefix##_03,prefix##_04,prefix##_05,prefix##_06,prefix##_07, \
prefix##_08,prefix##_09,prefix##_0a,prefix##_0b,prefix##_0c,prefix##_0d,prefix##_0e,prefix##_0f, \
@@ -387,7 +387,7 @@ PROTOTYPES(Z80xycb,xycb);
/* Burn an odd amount of cycles, that is instructions taking something */
/* different from 4 T-states per opcode (and R increment) */
/****************************************************************************/
-INLINE void BURNODD(z80_state_t *z80, int cycles, int opcodes, int cyclesum)
+static INLINE void BURNODD(z80_state_t *z80, int cycles, int opcodes, int cyclesum)
{
if( cycles > 0 )
{
@@ -399,7 +399,7 @@ INLINE void BURNODD(z80_state_t *z80, int cycles, int opcodes, int cyclesum)
/***************************************************************
* define an opcode function
***************************************************************/
-#define OP(prefix,opcode) INLINE void prefix##_##opcode(z80_state_t *z80)
+#define OP(prefix,opcode) static INLINE void prefix##_##opcode(z80_state_t *z80)
/***************************************************************
* adjust cycle count by n T-states
@@ -533,7 +533,7 @@ INLINE void BURNODD(z80_state_t *z80, int cycles, int opcodes, int cyclesum)
/***************************************************************
* Read a word from given memory location
***************************************************************/
-INLINE void RM16( z80_state_t *z80, UINT32 addr, PAIR *r )
+static INLINE void RM16( z80_state_t *z80, UINT32 addr, PAIR *r )
{
r->b.l = RM(addr);
r->b.h = RM((addr+1)&0xffff);
@@ -547,7 +547,7 @@ INLINE void RM16( z80_state_t *z80, UINT32 addr, PAIR *r )
/***************************************************************
* Write a word to given memory location
***************************************************************/
-INLINE void WM16( z80_state_t *z80, UINT32 addr, PAIR *r )
+static INLINE void WM16( z80_state_t *z80, UINT32 addr, PAIR *r )
{
WM(addr,r->b.l);
WM((addr+1)&0xffff,r->b.h);
@@ -558,7 +558,7 @@ INLINE void WM16( z80_state_t *z80, UINT32 addr, PAIR *r )
* reading opcodes. In case of system with memory mapped I/O,
* this function can be used to greatly speed up emulation
***************************************************************/
-INLINE UINT8 ROP(z80_state_t *z80)
+static INLINE UINT8 ROP(z80_state_t *z80)
{
unsigned pc = _PCD;
_PC++;
@@ -571,14 +571,14 @@ INLINE UINT8 ROP(z80_state_t *z80)
* support systems that use different encoding mechanisms for
* opcodes and opcode arguments
***************************************************************/
-INLINE UINT8 ARG(z80_state_t *z80)
+static INLINE UINT8 ARG(z80_state_t *z80)
{
unsigned pc = _PCD;
_PC++;
return cpu_readop_arg(z80->userdata, pc);
}
-INLINE UINT32 ARG16(z80_state_t *z80)
+static INLINE UINT32 ARG16(z80_state_t *z80)
{
unsigned pc = _PCD;
_PC += 2;
@@ -825,7 +825,7 @@ INLINE UINT32 ARG16(z80_state_t *z80)
/***************************************************************
* INC r8
***************************************************************/
-INLINE UINT8 INC(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 INC(z80_state_t *z80, UINT8 value)
{
UINT8 res = value + 1;
_F = (_F & CF) | z80->SZHV_inc[res];
@@ -835,7 +835,7 @@ INLINE UINT8 INC(z80_state_t *z80, UINT8 value)
/***************************************************************
* DEC r8
***************************************************************/
-INLINE UINT8 DEC(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 DEC(z80_state_t *z80, UINT8 value)
{
UINT8 res = value - 1;
_F = (_F & CF) | z80->SZHV_dec[res];
@@ -1493,7 +1493,7 @@ asm ( \
/***************************************************************
* RLC r8
***************************************************************/
-INLINE UINT8 RLC(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 RLC(z80_state_t *z80, UINT8 value)
{
unsigned res = value;
unsigned c = (res & 0x80) ? CF : 0;
@@ -1505,7 +1505,7 @@ INLINE UINT8 RLC(z80_state_t *z80, UINT8 value)
/***************************************************************
* RRC r8
***************************************************************/
-INLINE UINT8 RRC(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 RRC(z80_state_t *z80, UINT8 value)
{
unsigned res = value;
unsigned c = (res & 0x01) ? CF : 0;
@@ -1517,7 +1517,7 @@ INLINE UINT8 RRC(z80_state_t *z80, UINT8 value)
/***************************************************************
* RL r8
***************************************************************/
-INLINE UINT8 RL(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 RL(z80_state_t *z80, UINT8 value)
{
unsigned res = value;
unsigned c = (res & 0x80) ? CF : 0;
@@ -1529,7 +1529,7 @@ INLINE UINT8 RL(z80_state_t *z80, UINT8 value)
/***************************************************************
* RR r8
***************************************************************/
-INLINE UINT8 RR(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 RR(z80_state_t *z80, UINT8 value)
{
unsigned res = value;
unsigned c = (res & 0x01) ? CF : 0;
@@ -1541,7 +1541,7 @@ INLINE UINT8 RR(z80_state_t *z80, UINT8 value)
/***************************************************************
* SLA r8
***************************************************************/
-INLINE UINT8 SLA(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 SLA(z80_state_t *z80, UINT8 value)
{
unsigned res = value;
unsigned c = (res & 0x80) ? CF : 0;
@@ -1553,7 +1553,7 @@ INLINE UINT8 SLA(z80_state_t *z80, UINT8 value)
/***************************************************************
* SRA r8
***************************************************************/
-INLINE UINT8 SRA(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 SRA(z80_state_t *z80, UINT8 value)
{
unsigned res = value;
unsigned c = (res & 0x01) ? CF : 0;
@@ -1565,7 +1565,7 @@ INLINE UINT8 SRA(z80_state_t *z80, UINT8 value)
/***************************************************************
* SLL r8
***************************************************************/
-INLINE UINT8 SLL(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 SLL(z80_state_t *z80, UINT8 value)
{
unsigned res = value;
unsigned c = (res & 0x80) ? CF : 0;
@@ -1577,7 +1577,7 @@ INLINE UINT8 SLL(z80_state_t *z80, UINT8 value)
/***************************************************************
* SRL r8
***************************************************************/
-INLINE UINT8 SRL(z80_state_t *z80, UINT8 value)
+static INLINE UINT8 SRL(z80_state_t *z80, UINT8 value)
{
unsigned res = value;
unsigned c = (res & 0x01) ? CF : 0;
@@ -1606,7 +1606,7 @@ INLINE UINT8 SRL(z80_state_t *z80, UINT8 value)
/***************************************************************
* RES bit,r8
***************************************************************/
-INLINE UINT8 RES(z80_state_t *z80, UINT8 bit, UINT8 value)
+static INLINE UINT8 RES(z80_state_t *z80, UINT8 bit, UINT8 value)
{
return value & ~(1<<bit);
}
@@ -1614,7 +1614,7 @@ INLINE UINT8 RES(z80_state_t *z80, UINT8 bit, UINT8 value)
/***************************************************************
* SET bit,r8
***************************************************************/
-INLINE UINT8 SET(z80_state_t *z80, UINT8 bit, UINT8 value)
+static INLINE UINT8 SET(z80_state_t *z80, UINT8 bit, UINT8 value)
{
return value | (1<<bit);
}
diff --git a/plugins/ao/eng_ssf/scsp.c b/plugins/ao/eng_ssf/scsp.c
index f3a3d9da..0afff77e 100644
--- a/plugins/ao/eng_ssf/scsp.c
+++ b/plugins/ao/eng_ssf/scsp.c
@@ -858,7 +858,7 @@ void SCSP_TimersAddTicks(struct _SCSP *SCSP, int ticks)
}
}
-INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
+static INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
{
INT32 sample;
int step=slot->step;
diff --git a/plugins/ao/eng_ssf/scsplfo.c b/plugins/ao/eng_ssf/scsplfo.c
index c25e3c8d..0a8281c1 100644
--- a/plugins/ao/eng_ssf/scsplfo.c
+++ b/plugins/ao/eng_ssf/scsplfo.c
@@ -104,7 +104,7 @@ void LFO_Init(void)
}
}
-signed int INLINE PLFO_Step(struct _LFO *LFO)
+static signed int INLINE PLFO_Step(struct _LFO *LFO)
{
int p;
LFO->phase+=LFO->phase_step;
@@ -116,7 +116,7 @@ signed int INLINE PLFO_Step(struct _LFO *LFO)
return p<<(SHIFT-LFO_SHIFT);
}
-signed int INLINE ALFO_Step(struct _LFO *LFO)
+static signed int INLINE ALFO_Step(struct _LFO *LFO)
{
int p;
LFO->phase+=LFO->phase_step;
diff --git a/plugins/artwork/Makefile.am b/plugins/artwork/Makefile.am
index 11f98e24..9840b5e1 100644
--- a/plugins/artwork/Makefile.am
+++ b/plugins/artwork/Makefile.am
@@ -2,6 +2,11 @@ if HAVE_ARTWORK
artworkdir = $(libdir)/$(PACKAGE)
pkglib_LTLIBRARIES = artwork.la
+if HAVE_OGG
+ogg_def = -DUSE_OGG=1
+ogg_libs = $(OGG_LIBS)
+endif
+
if ARTWORK_USE_VFS_CURL
artwork_net_cflags = -DUSE_VFS_CURL
artwork_net_sources = albumartorg.c albumartorg.h lastfm.c lastfm.h wos.c wos.h escape.c escape.h
@@ -24,6 +29,6 @@ FLAC_DEPS=$(FLAC_LIBS)
flac_cflags=-DUSE_METAFLAC $(FLAC_CFLAGS)
endif
-AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(flac_cflags) $(artwork_net_cflags) -std=c99
-artwork_la_LIBADD = $(LDADD) $(ARTWORK_DEPS) $(FLAC_DEPS)
+AM_CFLAGS = $(CFLAGS) $(ARTWORK_CFLAGS) $(flac_cflags) $(artwork_net_cflags) $(ogg_def) -std=c99
+artwork_la_LIBADD = $(LDADD) $(ARTWORK_DEPS) $(FLAC_DEPS) $(ogg_libs)
endif
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c
index 9a3caa76..32cd1b96 100644
--- a/plugins/artwork/artwork.c
+++ b/plugins/artwork/artwork.c
@@ -122,7 +122,7 @@ static time_t artwork_reset_time;
static char artwork_filemask[200];
static const char *get_default_cover (void) {
-return default_cover;
+ return default_cover;
}
static int
@@ -144,10 +144,15 @@ make_cache_dir_path (char *path, int size, const char *artist, int img_size) {
char esc_artist[PATH_MAX];
int i;
- for (i = 0; artist[i]; i++) {
- esc_artist[i] = esc_char (artist[i]);
+ if (artist) {
+ for (i = 0; artist[i]; i++) {
+ esc_artist[i] = esc_char (artist[i]);
+ }
+ esc_artist[i] = 0;
+ }
+ else {
+ strcpy (esc_artist, "Unknown artist");
}
- esc_artist[i] = 0;
const char *cache = getenv ("XDG_CACHE_HOME");
int sz;
@@ -906,6 +911,43 @@ id3v2_skip_str (int enc, uint8_t *ptr, uint8_t *end) {
return NULL;
}
+#ifdef USE_METAFLAC
+static size_t
+flac_io_read (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle) {
+ return deadbeef->fread (ptr, size, nmemb, (DB_FILE *)handle);
+}
+
+static int
+flac_io_seek (FLAC__IOHandle handle, FLAC__int64 offset, int whence) {
+ return deadbeef->fseek ((DB_FILE *)handle, offset, whence);
+}
+
+static FLAC__int64
+flac_io_tell (FLAC__IOHandle handle) {
+ return deadbeef->ftell ((DB_FILE *)handle);
+}
+
+static int
+flac_io_eof (FLAC__IOHandle handle) {
+ int64_t pos = deadbeef->ftell ((DB_FILE *)handle);
+ return pos == deadbeef->fgetlength ((DB_FILE *)handle);
+}
+
+static int
+flac_io_close (FLAC__IOHandle handle) {
+ deadbeef->fclose ((DB_FILE *)handle);
+ return 0;
+}
+
+static FLAC__IOCallbacks iocb = {
+ .read = flac_io_read,
+ .write = NULL,
+ .seek = flac_io_seek,
+ .tell = flac_io_tell,
+ .eof = flac_io_eof,
+ .close = flac_io_close,
+};
+#endif
static void
fetcher_thread (void *none)
@@ -964,11 +1006,23 @@ fetcher_thread (void *none)
trace ("artwork: id3v2 APIC frame is too small\n");
continue;
}
+
uint8_t *data = f->data;
- if (tag.version[0] == 4) {
- // skip size
+
+ if (tag.version[0] == 4 && (f->flags[1] & 1)) {
data += 4;
}
+#if 0
+ printf ("version: %d, flags: %d %d\n", (int)tag.version[0], (int)f->flags[0], (int)f->flags[1]);
+ for (int i = 0; i < 20; i++) {
+ printf ("%c", data[i] < 0x20 ? '?' : data[i]);
+ }
+ printf ("\n");
+ for (int i = 0; i < 20; i++) {
+ printf ("%02x ", data[i]);
+ }
+ printf ("\n");
+#endif
uint8_t *end = f->data + f->size;
int enc = *data;
data++; // enc
@@ -1112,11 +1166,29 @@ fetcher_thread (void *none)
is_ogg = 1;
}
- if(! (is_ogg? FLAC__metadata_chain_read_ogg(chain, filename) : FLAC__metadata_chain_read(chain, filename)) ) {
- trace ("%s: ERROR: reading metadata", filename);
+ DB_FILE *file = deadbeef->fopen (filename);
+ if (!file) {
+ break;
+ }
+
+ int res = 0;
+ if (is_ogg) {
+#if USE_OGG
+ res = FLAC__metadata_chain_read_ogg_with_callbacks(chain, (FLAC__IOHandle)file, iocb);
+#endif
+ }
+ else
+ {
+ res = FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, iocb);
+ }
+
+ if(!res) {
+ trace ("artwork: failed to read metadata from flac: %s\n", filename);
+ deadbeef->fclose (file);
FLAC__metadata_chain_delete(chain);
break;
}
+ deadbeef->fclose (file);
FLAC__StreamMetadata *picture = 0;
FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new();
FLAC__metadata_iterator_init(iterator, chain);
@@ -1207,17 +1279,24 @@ fetcher_thread (void *none)
if (files_count > 0) {
trace ("found cover for %s - %s in local folder\n", param->artist, param->album);
- if (check_dir (path, 0755)) {
- strcat (path, "/");
- strcat (path, files[0]->d_name);
- char cache_path[1024];
- char tmp_path[1024];
- make_cache_path2 (cache_path, sizeof (cache_path), param->fname, param->album, param->artist, -1);
+ strcat (path, "/");
+ strcat (path, files[0]->d_name);
+ char cache_path[PATH_MAX];
+ char tmp_path[PATH_MAX];
+ char cache_path_dir[PATH_MAX];
+ make_cache_path2 (cache_path, sizeof (cache_path), param->fname, param->album, param->artist, -1);
+ strcpy (cache_path_dir, cache_path);
+ char *slash = strrchr (cache_path_dir, '/');
+ if (slash) {
+ *slash = 0;
+ }
+ trace ("check_dir: %s\n", cache_path_dir);
+ if (check_dir (cache_path_dir, 0755)) {
snprintf (tmp_path, sizeof (tmp_path), "%s.part", cache_path);
copy_file (path, tmp_path, -1);
int err = rename (tmp_path, cache_path);
if (err != 0) {
- trace ("Failed to move %s to %s: %s\n", tmp_path, cache_path, strerror (err));
+ trace ("artwork: rename error %d: failed to move %s to %s: %s\n", err, tmp_path, cache_path, strerror (err));
unlink (tmp_path);
}
int i;
@@ -1308,7 +1387,7 @@ find_image (const char *path) {
// invalidate cache every 2 days
if ((cache_period > 0 && (tm - stat_buf.st_mtime > cache_period * 60 * 60))
|| artwork_reset_time > stat_buf.st_mtime) {
- trace ("reloading cached file %s\n", path);
+ trace ("deleting cached file %s\n", path);
unlink (path);
return NULL;
}
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c
index a0e7a218..fc8989c4 100644
--- a/plugins/converter/converter.c
+++ b/plugins/converter/converter.c
@@ -32,6 +32,7 @@
#include <dirent.h>
#include <fcntl.h>
#include <unistd.h>
+#include <inttypes.h>
#include "converter.h"
#include "../../deadbeef.h"
#include "../../strdupa.h"
@@ -1019,7 +1020,7 @@ convert (DB_playItem_t *it, const char *out, int output_bps, int output_is_float
}
uint64_t chunksize;
- chunksize = size + 36;
+ chunksize = size + 40;
// for float, add 36 more
if (output_is_float) {
@@ -1058,7 +1059,7 @@ convert (DB_playItem_t *it, const char *out, int output_bps, int output_is_float
int64_t res = write (temp_file, buffer, sz);
if (sz != res) {
- fprintf (stderr, "converter: write error (%lld bytes written out of %d)\n", res, sz);
+ fprintf (stderr, "converter: write error (%"PRId64" bytes written out of %d)\n", res, sz);
goto error;
}
}
@@ -1133,8 +1134,11 @@ error:
*o++ = *p++;
}
*o = 0;
+ // FIXME: need to delete all colon-fields, except the URI
deadbeef->pl_replace_meta (out_it, ":URI", unesc_path);
+ deadbeef->pl_delete_meta (out_it, ":TRACKNUM");
deadbeef->pl_delete_meta (out_it, "cuesheet");
+ deadbeef->pl_set_item_flags (out_it, 0);
}
uint32_t tagflags = 0;
diff --git a/plugins/converter/convgui.c b/plugins/converter/convgui.c
index e1ebdfb1..a1207da2 100644
--- a/plugins/converter/convgui.c
+++ b/plugins/converter/convgui.c
@@ -911,6 +911,7 @@ on_encoder_preset_cursor_changed (GtkTreeView *treeview,
gpointer user_data) {
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (treeview));
GtkWidget *edit = lookup_widget (toplevel, "edit");
+ GtkWidget *remove = lookup_widget (toplevel, "remove");
GtkTreePath *path;
GtkTreeViewColumn *col;
@@ -918,6 +919,7 @@ on_encoder_preset_cursor_changed (GtkTreeView *treeview,
if (!path || !col) {
// nothing selected
gtk_widget_set_sensitive (edit, FALSE);
+ gtk_widget_set_sensitive (remove, FALSE);
return;
}
int *indices = gtk_tree_path_get_indices (path);
@@ -926,6 +928,7 @@ on_encoder_preset_cursor_changed (GtkTreeView *treeview,
ddb_encoder_preset_t *p = converter_plugin->encoder_preset_get_for_idx (idx);
gtk_widget_set_sensitive (edit, !p->readonly);
+ gtk_widget_set_sensitive (remove, !p->readonly);
}
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c
index 977298b0..93ed1224 100644
--- a/plugins/flac/flac.c
+++ b/plugins/flac/flac.c
@@ -81,6 +81,8 @@ typedef struct {
const char *fname;
int bitrate;
FLAC__StreamMetadata *flac_cue_sheet;
+
+ int got_vorbis_comments;
} flac_info_t;
// callbacks
@@ -609,6 +611,7 @@ cflac_init_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__Str
f |= DDB_TAG_VORBISCOMMENTS;
deadbeef->pl_set_item_flags (it, f);
}
+ info->got_vorbis_comments = 1;
}
else if (metadata->type == FLAC__METADATA_TYPE_CUESHEET) {
if (!info->flac_cue_sheet) {
@@ -620,6 +623,15 @@ cflac_init_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__Str
static DB_playItem_t *
cflac_insert_with_embedded_cue (ddb_playlist_t *plt, DB_playItem_t *after, DB_playItem_t *origin, const FLAC__StreamMetadata_CueSheet *cuesheet, int totalsamples, int samplerate) {
DB_playItem_t *ins = after;
+
+ // first check if cuesheet is matching the data
+ for (int i = 0; i < cuesheet->num_tracks; i++) {
+ if (cuesheet->tracks[i].offset >= totalsamples) {
+ fprintf (stderr, "The flac %s has invalid embedded cuesheet. You should remove it using metaflac.\n", deadbeef->pl_find_meta_raw (origin, ":URI"));
+ return NULL;
+ }
+ }
+
for (int i = 0; i < cuesheet->num_tracks-1; i++) {
const char *uri = deadbeef->pl_find_meta_raw (origin, ":URI");
const char *dec = deadbeef->pl_find_meta_raw (origin, ":DECODER");
@@ -682,6 +694,8 @@ cflac_free_temp (DB_fileinfo_t *_info) {
}
}
+static int
+cflac_read_metadata (DB_playItem_t *it);
static DB_playItem_t *
cflac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) {
@@ -777,11 +791,12 @@ cflac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) {
if (info.info.fmt.samplerate <= 0) {
goto cflac_insert_fail;
}
+ int64_t fsize = deadbeef->fgetlength (info.file);
+ int is_streaming = info.file->vfs->is_streaming ();
deadbeef->pl_add_meta (it, ":FILETYPE", isogg ? "OggFLAC" : "FLAC");
char s[100];
- int64_t fsize = deadbeef->fgetlength (info.file);
snprintf (s, sizeof (s), "%lld", fsize);
deadbeef->pl_add_meta (it, ":FILE_SIZE", s);
snprintf (s, sizeof (s), "%d", info.info.fmt.channels);
@@ -808,6 +823,13 @@ cflac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) {
FLAC__stream_decoder_delete(decoder);
decoder = NULL;
+ deadbeef->fclose (info.file);
+ info.file = NULL;
+
+ if (!info.got_vorbis_comments && !is_streaming) {
+ cflac_read_metadata (it);
+ }
+
// try embedded cue
deadbeef->pl_lock ();
if (info.flac_cue_sheet) {
@@ -856,7 +878,43 @@ cflac_insert_fail:
return NULL;
}
-int
+static size_t
+flac_io_read (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle) {
+ return deadbeef->fread (ptr, size, nmemb, (DB_FILE *)handle);
+}
+
+static int
+flac_io_seek (FLAC__IOHandle handle, FLAC__int64 offset, int whence) {
+ return deadbeef->fseek ((DB_FILE *)handle, offset, whence);
+}
+
+static FLAC__int64
+flac_io_tell (FLAC__IOHandle handle) {
+ return deadbeef->ftell ((DB_FILE *)handle);
+}
+
+static int
+flac_io_eof (FLAC__IOHandle handle) {
+ int64_t pos = deadbeef->ftell ((DB_FILE *)handle);
+ return pos == deadbeef->fgetlength ((DB_FILE *)handle);
+}
+
+static int
+flac_io_close (FLAC__IOHandle handle) {
+ deadbeef->fclose ((DB_FILE *)handle);
+ return 0;
+}
+
+static FLAC__IOCallbacks iocb = {
+ .read = flac_io_read,
+ .write = NULL,
+ .seek = flac_io_seek,
+ .tell = flac_io_tell,
+ .eof = flac_io_eof,
+ .close = flac_io_close,
+};
+
+static int
cflac_read_metadata (DB_playItem_t *it) {
int err = -1;
FLAC__Metadata_Chain *chain = NULL;
@@ -868,11 +926,17 @@ cflac_read_metadata (DB_playItem_t *it) {
return -1;
}
deadbeef->pl_lock ();
- FLAC__bool res = FLAC__metadata_chain_read (chain, deadbeef->pl_find_meta (it, ":URI"));
+ DB_FILE *file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
+ deadbeef->pl_unlock ();
+ if (!file) {
+ return -1;
+ }
+ FLAC__bool res = FLAC__metadata_chain_read_with_callbacks (chain, (FLAC__IOHandle)file, iocb);
if (!res && FLAC__metadata_chain_status(chain) == FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE) {
- res = FLAC__metadata_chain_read_ogg (chain, deadbeef->pl_find_meta (it, ":URI"));
+ res = FLAC__metadata_chain_read_ogg_with_callbacks (chain, (FLAC__IOHandle)file, iocb);
}
- deadbeef->pl_unlock ();
+ deadbeef->fclose (file);
+ file = NULL;
if (!res) {
trace ("cflac_read_metadata: FLAC__metadata_chain_read(_ogg) failed\n");
goto error;
@@ -955,7 +1019,7 @@ cflac_write_metadata (DB_playItem_t *it) {
chain = FLAC__metadata_chain_new ();
if (!chain) {
- trace ("cflac_write_metadata: FLAC__metadata_chain_new failed\n");
+ fprintf (stderr, "cflac_write_metadata: FLAC__metadata_chain_new failed\n");
return -1;
}
deadbeef->pl_lock ();
@@ -969,7 +1033,7 @@ cflac_write_metadata (DB_playItem_t *it) {
#endif
deadbeef->pl_unlock ();
if (!res) {
- trace ("cflac_write_metadata: FLAC__metadata_chain_read(_ogg) failed - code %d\n", res);
+ fprintf (stderr, "cflac_write_metadata: FLAC__metadata_chain_read(_ogg) failed - code %d\n", res);
goto error;
}
FLAC__metadata_chain_merge_padding (chain);
@@ -1070,11 +1134,13 @@ cflac_write_metadata (DB_playItem_t *it) {
}
#if USE_OGGEDIT
else {
- res = cflac_write_metadata_ogg(it, &data->data.vorbis_comment);
+ if (cflac_write_metadata_ogg(it, &data->data.vorbis_comment)) {
+ res = 0;
+ }
}
#endif
- if (res) {
- trace ("cflac_write_metadata: failed to write tags: code %d\n", res);
+ if (!res) {
+ fprintf (stderr, "cflac_write_metadata: failed to write tags: code %d\n", res);
goto error;
}
diff --git a/plugins/gme/cgme.c b/plugins/gme/cgme.c
index 712643e2..d172664e 100644
--- a/plugins/gme/cgme.c
+++ b/plugins/gme/cgme.c
@@ -85,7 +85,7 @@ read_gzfile (const char *fname, char **buffer, int *size) {
tmp = "/tmp";
}
char nm[PATH_MAX];
-#ifdef ANDROID
+#if defined(ANDROID) || defined(STATICLINK)
snprintf (nm, sizeof (nm), "%s/ddbgmeXXXXXX", tmp);
fd = mkstemp (nm);
#else
diff --git a/plugins/gtkui/coverart.c b/plugins/gtkui/coverart.c
index f7d78696..0ff63ceb 100644
--- a/plugins/gtkui/coverart.c
+++ b/plugins/gtkui/coverart.c
@@ -43,6 +43,7 @@ GdkPixbuf *pixbuf_default;
typedef struct {
struct timeval tm;
+ time_t file_time;
char *fname;
int width;
GdkPixbuf *pixbuf;
@@ -71,6 +72,8 @@ static uintptr_t tid;
load_query_t *queue;
load_query_t *tail;
+static int64_t artwork_reset_time;
+
static void
queue_add (const char *fname, int width, void (*callback) (void *user_data), void *user_data) {
deadbeef->mutex_lock (mutex);
@@ -175,11 +178,14 @@ loading_thread (void *none) {
}
GdkPixbuf *pixbuf = NULL;
GError *error = NULL;
- pixbuf = gdk_pixbuf_new_from_file_at_scale (queue->fname, queue->width, queue->width, TRUE, &error);
- if (error) {
- //fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", queue->fname, queue->width, error ? error->message : "n/a");
- g_error_free (error);
- error = NULL;
+ struct stat stat_buf;
+ if (!stat (queue->fname, &stat_buf)) {
+ pixbuf = gdk_pixbuf_new_from_file_at_scale (queue->fname, queue->width, queue->width, TRUE, &error);
+ if (error) {
+ //fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", queue->fname, queue->width, error ? error->message : "n/a");
+ g_error_free (error);
+ error = NULL;
+ }
}
if (!pixbuf) {
pixbuf = pixbuf_default;
@@ -189,6 +195,7 @@ loading_thread (void *none) {
deadbeef->mutex_lock (mutex);
cache[cache_min].pixbuf = pixbuf;
cache[cache_min].fname = strdup (queue->fname);
+ cache[cache_min].file_time = stat_buf.st_mtime;
gettimeofday (&cache[cache_min].tm, NULL);
cache[cache_min].width = queue->width;
deadbeef->mutex_unlock (mutex);
@@ -406,3 +413,26 @@ int
gtkui_is_default_pixbuf (GdkPixbuf *pb) {
return pb == pixbuf_default;
}
+
+int
+gtkui_cover_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
+ switch (id) {
+ case DB_EV_PLAYLIST_REFRESH:
+ {
+ int64_t reset_time = deadbeef->conf_get_int64 ("artwork.cache_reset_time", 0);;
+ if (reset_time != artwork_reset_time) {
+ artwork_reset_time = reset_time;
+ deadbeef->mutex_lock (mutex);
+ for (int i = 0; i < CACHE_SIZE; i++) {
+ if (cache[i].pixbuf) {
+ g_object_unref (cache[i].pixbuf);
+ }
+ }
+ memset (cache, 0, sizeof (cache));
+ deadbeef->mutex_unlock (mutex);
+ }
+ }
+ break;
+ }
+ return 0;
+}
diff --git a/plugins/gtkui/coverart.h b/plugins/gtkui/coverart.h
index bacbfd92..47627fe7 100644
--- a/plugins/gtkui/coverart.h
+++ b/plugins/gtkui/coverart.h
@@ -51,5 +51,8 @@ cover_get_default_pixbuf (void);
int
gtkui_is_default_pixbuf (GdkPixbuf *pb);
+int
+gtkui_cover_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2);
+
#endif
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index 57dd0cbe..59ac4533 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -6349,7 +6349,7 @@ if you don't press Apply.</property>
<widget class="GtkCheckButton" id="set_custom_title">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Set custom title</property>
+ <property name="label" translatable="yes">Set Custom Title</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
@@ -8827,7 +8827,7 @@ Descending</property>
<widget class="GtkCheckButton" id="set_custom_title">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Set custom title</property>
+ <property name="label" translatable="yes">Set Custom Title</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index 5e2cbd2f..a3cca159 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -772,6 +772,7 @@ gtkui_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
if (rootwidget) {
send_messages_to_widgets (rootwidget, id, ctx, p1, p2);
}
+ gtkui_cover_message (id, ctx, p1, p2);
switch (id) {
case DB_EV_ACTIVATED:
g_idle_add (activate_cb, NULL);
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index c4c02b73..d17269c6 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -3225,7 +3225,7 @@ create_addlocationdlg (void)
hbox122 = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox45), hbox122, TRUE, TRUE, 0);
- set_custom_title = gtk_check_button_new_with_mnemonic (_("Set custom title"));
+ set_custom_title = gtk_check_button_new_with_mnemonic (_("Set Custom Title"));
gtk_widget_show (set_custom_title);
gtk_box_pack_start (GTK_BOX (hbox122), set_custom_title, FALSE, FALSE, 0);
@@ -4439,7 +4439,7 @@ create_setcustomtitledlg (void)
gtk_widget_show (hbox123);
gtk_box_pack_start (GTK_BOX (vbox46), hbox123, FALSE, TRUE, 0);
- set_custom_title = gtk_check_button_new_with_mnemonic (_("Set custom title"));
+ set_custom_title = gtk_check_button_new_with_mnemonic (_("Set Custom Title"));
gtk_widget_show (set_custom_title);
gtk_box_pack_start (GTK_BOX (hbox123), set_custom_title, FALSE, FALSE, 0);
diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c
index 1bacb50e..51b37c28 100644
--- a/plugins/gtkui/widgets.c
+++ b/plugins/gtkui/widgets.c
@@ -2349,6 +2349,9 @@ static int
coverart_message (ddb_gtkui_widget_t *w, uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
w_coverart_t *ca = (w_coverart_t *)w;
switch (id) {
+ case DB_EV_PLAYLIST_REFRESH:
+ g_idle_add (coverart_redraw_cb, w);
+ break;
case DB_EV_SONGSTARTED:
g_idle_add (coverart_redraw_cb, w);
break;
diff --git a/plugins/liboggedit/oggedit_internal.c b/plugins/liboggedit/oggedit_internal.c
index f3c9b2d9..c8257da5 100644
--- a/plugins/liboggedit/oggedit_internal.c
+++ b/plugins/liboggedit/oggedit_internal.c
@@ -142,8 +142,9 @@ int open_temp_file(const char *fname, char *tempname, FILE **out)
return OGGEDIT_CANNOT_OPEN_TEMPORARY_FILE;
struct stat stat_struct;
- if (!stat(fname, &stat_struct))
+ if (!stat(fname, &stat_struct)) {
chmod(tempname, stat_struct.st_mode);
+ }
return 0;
}
diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c
index 56602c4c..ff3320b5 100644
--- a/plugins/m3u/m3u.c
+++ b/plugins/m3u/m3u.c
@@ -322,16 +322,9 @@ load_pls (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab
}
const uint8_t *e;
int n;
- if (!strncasecmp (p, "numberofentries=", 16) || !strncasecmp (p, "version=", 8)) {
- while (p < end && *p >= 0x20) {
- p++;
- }
- continue;
- }
- else if (!strncasecmp (p, "file", 4)) {
+ if (!strncasecmp (p, "file", 4)) {
int idx = atoi (p + 4);
if (uri[0] && idx != lastidx && lastidx != -1) {
- trace ("uri%d\n", idx);
DB_playItem_t *it = pls_insert_file (plt, after, fname, uri, pabort, cb, user_data, title, length);
if (it) {
after = it;
@@ -350,6 +343,9 @@ load_pls (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab
p++;
}
p++;
+ while (p < end && *p <= 0x20) {
+ p++;
+ }
if (p >= end) {
break;
}
@@ -387,6 +383,9 @@ load_pls (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab
p++;
}
p++;
+ while (p < end && *p <= 0x20) {
+ p++;
+ }
if (p >= end) {
break;
}
diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c
index 538b4807..458b8a9f 100644
--- a/plugins/oss/oss.c
+++ b/plugins/oss/oss.c
@@ -73,7 +73,7 @@ oss_set_hwparams (ddb_waveformat_t *fmt) {
break;
}
if (ioctl (fd, SNDCTL_DSP_SETFMT, &samplefmt) == -1) {
- fprintf (stderr, "oss: failed to set format\n");
+ fprintf (stderr, "oss: failed to set format (return: %d)\n", samplefmt);
perror ("SNDCTL_DSP_SETFMT");
return -1;
}
@@ -195,8 +195,6 @@ oss_pause (void) {
if (state == OUTPUT_STATE_STOPPED) {
return -1;
}
- // set pause state
- oss_free();
state = OUTPUT_STATE_PAUSED;
return 0;
}
@@ -213,18 +211,15 @@ oss_setformat (ddb_waveformat_t *fmt) {
}
int _state = state;
- int v4workaround = deadbeef->conf_get_int ("oss.v4workaround", 0);
deadbeef->mutex_lock (mutex);
- if (v4workaround) {
- if (fd) {
- close (fd);
- fd = 0;
- }
- fd = open (oss_device, O_WRONLY);
- memcpy (&plugin.fmt, fmt, sizeof (ddb_waveformat_t));
+ if (fd) {
+ close (fd);
+ fd = 0;
}
+ fd = open (oss_device, O_WRONLY);
+ memcpy (&plugin.fmt, fmt, sizeof (ddb_waveformat_t));
if (0 != oss_set_hwparams (fmt)) {
deadbeef->mutex_unlock (mutex);
return -1;
@@ -369,8 +364,7 @@ oss_load (DB_functions_t *api) {
}
static const char settings_dlg[] =
- "property \"Device file\" entry oss.device /dev/dsp;\n"
- "property \"OSS4 samplerate bug workaround\" checkbox oss.v4workaround 0;\n";
+ "property \"Device file\" entry oss.device /dev/dsp;\n";
// define plugin interface
static DB_output_t plugin = {
diff --git a/plugins/shellexecui/callbacks.c b/plugins/shellexecui/callbacks.c
index b8fb56d3..019fde92 100644
--- a/plugins/shellexecui/callbacks.c
+++ b/plugins/shellexecui/callbacks.c
@@ -8,4 +8,3 @@
#include "interface.h"
#include "support.h"
-
diff --git a/plugins/shellexecui/callbacks.h b/plugins/shellexecui/callbacks.h
index c4b57687..4b1f2037 100644
--- a/plugins/shellexecui/callbacks.h
+++ b/plugins/shellexecui/callbacks.h
@@ -28,3 +28,7 @@ on_edit_cancel_button_clicked (GtkButton *button,
void
on_edit_ok_button_clicked (GtkButton *button,
gpointer user_data);
+
+void
+on_shellexec_conf_dialog_destroy (GObject *object,
+ gpointer user_data);
diff --git a/plugins/shellexecui/interface.c b/plugins/shellexecui/interface.c
index d00c0fc7..6296617b 100644
--- a/plugins/shellexecui/interface.c
+++ b/plugins/shellexecui/interface.c
@@ -44,6 +44,7 @@ create_shellexec_conf_dialog (void)
shellexec_conf_dialog = gtk_dialog_new ();
gtk_container_set_border_width (GTK_CONTAINER (shellexec_conf_dialog), 12);
gtk_window_set_title (GTK_WINDOW (shellexec_conf_dialog), _("Custom Shell Commands"));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (shellexec_conf_dialog), TRUE);
gtk_window_set_type_hint (GTK_WINDOW (shellexec_conf_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_dialog_set_has_separator (GTK_DIALOG (shellexec_conf_dialog), FALSE);
@@ -89,6 +90,9 @@ create_shellexec_conf_dialog (void)
gtk_dialog_add_action_widget (GTK_DIALOG (shellexec_conf_dialog), save_button, 0);
gtk_widget_set_can_default(save_button, TRUE);
+ g_signal_connect ((gpointer) shellexec_conf_dialog, "destroy",
+ G_CALLBACK (on_shellexec_conf_dialog_destroy),
+ NULL);
g_signal_connect ((gpointer) add_button, "clicked",
G_CALLBACK (on_add_button_clicked),
NULL);
diff --git a/plugins/shellexecui/shellexec.glade b/plugins/shellexecui/shellexec.glade
index aea894ae..aa872167 100644
--- a/plugins/shellexecui/shellexec.glade
+++ b/plugins/shellexecui/shellexec.glade
@@ -11,7 +11,7 @@
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
+ <property name="destroy_with_parent">True</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
@@ -20,6 +20,7 @@
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">False</property>
+ <signal name="destroy" handler="on_shellexec_conf_dialog_destroy" last_modification_time="Fri, 27 Jun 2014 18:45:21 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox">
diff --git a/plugins/shellexecui/shellexecui.c b/plugins/shellexecui/shellexecui.c
index 482cec2b..6b6744dd 100644
--- a/plugins/shellexecui/shellexecui.c
+++ b/plugins/shellexecui/shellexecui.c
@@ -345,9 +345,20 @@ init_treeview() {
g_object_unref(liststore);
}
+void
+on_shellexec_conf_dialog_destroy (GObject *object,
+ gpointer user_data)
+{
+ conf_dlg = NULL;
+}
+
+
static gboolean
shellexecui_action_gtk (void *data)
{
+ if (conf_dlg) {
+ return FALSE;
+ }
conf_dlg = create_shellexec_conf_dialog();
gtk_widget_set_size_request (conf_dlg, 400, 400);
gtk_window_set_transient_for(GTK_WINDOW(conf_dlg),
diff --git a/plugins/wma/wma_plugin.c b/plugins/wma/wma_plugin.c
index 71c70a2e..8bee83e2 100644
--- a/plugins/wma/wma_plugin.c
+++ b/plugins/wma/wma_plugin.c
@@ -63,6 +63,7 @@ typedef struct {
int skipsamples;
char buffer[200000]; // can't predict its size, so set to max
int remaining;
+ int open2_was_used;
} wmaplug_info_t;
// allocate codec control structure
@@ -71,6 +72,23 @@ wmaplug_open (uint32_t hints) {
DB_fileinfo_t *_info = malloc (sizeof (wmaplug_info_t));
wmaplug_info_t *info = (wmaplug_info_t *)_info;
memset (info, 0, sizeof (wmaplug_info_t));
+
+ return _info;
+}
+
+static DB_fileinfo_t *
+wmaplug_open2 (uint32_t hints, DB_playItem_t *it) {
+ DB_FILE *file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
+ if (!file) {
+ return NULL;
+ }
+
+ DB_fileinfo_t *_info = malloc (sizeof (wmaplug_info_t));
+ wmaplug_info_t *info = (wmaplug_info_t *)_info;
+ memset (info, 0, sizeof (wmaplug_info_t));
+ info->open2_was_used = 1;
+ info->info.file = file;
+
return _info;
}
@@ -80,7 +98,10 @@ static int
wmaplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
wmaplug_info_t *info = (wmaplug_info_t *)_info;
- info->info.file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
+ if (!info->open2_was_used) {
+ info->info.file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
+ }
+
if (!info->info.file) {
return -1;
}
@@ -457,7 +478,7 @@ static const char * exts[] = { "wma", NULL };
// define plugin interface
static DB_decoder_t plugin = {
.plugin.api_vmajor = 1,
- .plugin.api_vminor = 0,
+ .plugin.api_vminor = 7,
.plugin.version_major = 1,
.plugin.version_minor = 0,
.plugin.type = DB_PLUGIN_DECODER,
@@ -489,6 +510,7 @@ static DB_decoder_t plugin = {
,
.plugin.website = "http://deadbeef.sf.net",
.open = wmaplug_open,
+ .open2 = wmaplug_open2,
.init = wmaplug_init,
.free = wmaplug_free,
.read = wmaplug_read,