|
|
|
@ -39,24 +39,35 @@ static TQString getSavePath(void)
|
|
|
|
|
return dirs.saveLocation("data", "noatun/") + "tylerstates";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" void save_effect(t_effect *effect)
|
|
|
|
|
extern "C"
|
|
|
|
|
{
|
|
|
|
|
KDE_EXPORT void save_effect(t_effect *effect)
|
|
|
|
|
{
|
|
|
|
|
TQFile file(getSavePath());
|
|
|
|
|
if(!file.open(IO_WriteOnly))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(unsigned i = 0; i < sizeof(t_effect); i++)
|
|
|
|
|
{
|
|
|
|
|
file.putch( *((byte *)effect + i) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
t_effect effects[100];
|
|
|
|
|
int nb_effects=0;
|
|
|
|
|
|
|
|
|
|
extern "C" void load_effects()
|
|
|
|
|
extern "C"
|
|
|
|
|
{
|
|
|
|
|
KDE_EXPORT void load_effects()
|
|
|
|
|
{
|
|
|
|
|
TQFile file(getDataPath());
|
|
|
|
|
if(!file.open(IO_ReadOnly))
|
|
|
|
|
{
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned int i;
|
|
|
|
|
nb_effects = 0;
|
|
|
|
@ -64,11 +75,16 @@ extern "C" void load_effects()
|
|
|
|
|
{
|
|
|
|
|
byte* ptr_effect = (byte *)&effects[nb_effects++];
|
|
|
|
|
for(i = 0; i < sizeof(t_effect); i++)
|
|
|
|
|
{
|
|
|
|
|
ptr_effect[i] = file.getch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" void load_random_effect(t_effect *effect)
|
|
|
|
|
extern "C"
|
|
|
|
|
{
|
|
|
|
|
KDE_EXPORT void load_random_effect(t_effect *effect)
|
|
|
|
|
{
|
|
|
|
|
if(nb_effects > 0)
|
|
|
|
|
{
|
|
|
|
@ -76,6 +92,9 @@ extern "C" void load_random_effect(t_effect *effect)
|
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
|
|
for(i = 0; i < sizeof(t_effect) ; i++)
|
|
|
|
|
{
|
|
|
|
|
*((byte*)effect+i) = *((byte*)(&effects[num_effect])+i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|