mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-04 16:51:37 -05:00
-Clip names shown in GUI when files loaded
This commit is contained in:
parent
e84a39357f
commit
7f96d72d77
4 changed files with 31 additions and 4 deletions
|
@ -49,7 +49,7 @@ class AudioBuffer
|
|||
numBeats = 0;
|
||||
audioFrames = 0;
|
||||
memset( name, 0, sizeof(char)*20 );
|
||||
sprintf( name, "%i", ID );
|
||||
//sprintf( name, "%i", ID );
|
||||
}
|
||||
|
||||
/// this function is used for "resizing" an exisiting buffer, and should
|
||||
|
@ -77,6 +77,11 @@ class AudioBuffer
|
|||
memcpy( name, n, sizeof(char)* 20 );
|
||||
}
|
||||
|
||||
char* getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
int getBeats()
|
||||
{
|
||||
return numBeats;
|
||||
|
|
|
@ -214,7 +214,10 @@ void ClipSelector::draw()
|
|||
cairo_move_to( cr, x + clipHeight + 5, drawY + textHeight );
|
||||
cairo_set_source_rgba( cr, 255 / 255.f, 255 / 255.f , 255 / 255.f , 0.9 );
|
||||
cairo_set_font_size( cr, 11 );
|
||||
cairo_show_text( cr, clips[i].getName().c_str() );
|
||||
|
||||
std::string tmp = clips[i].getName().substr(0,8);
|
||||
|
||||
cairo_show_text( cr, tmp.c_str() );
|
||||
|
||||
// special indicator?
|
||||
if ( i == special )
|
||||
|
|
|
@ -91,6 +91,9 @@ int DiskReader::loadPreferences()
|
|||
LUPPP_NOTE("No default controllers active.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
cJSON_Delete( preferencesJson );
|
||||
delete[] sampleString;
|
||||
}
|
||||
|
@ -174,7 +177,10 @@ int DiskReader::loadSample( int track, int scene, string path )
|
|||
data.end_of_input = 0;
|
||||
data.src_ratio = resampleRatio;
|
||||
|
||||
int ret = src_simple ( &data, SRC_SINC_FASTEST, 1 );
|
||||
|
||||
// FIXME: ADD FEATURE: Config option for resampling quality on load?
|
||||
int ret = src_simple ( &data, SRC_LINEAR, 1 );
|
||||
//int ret = src_simple ( &data, SRC_SINC_FASTEST, 1 );
|
||||
|
||||
LUPPP_NOTE("%s%i%s%i", "Resampling finished, from ", data.input_frames_used, " to ", data.output_frames_gen );
|
||||
|
||||
|
@ -276,16 +282,29 @@ int DiskReader::loadSample( int track, int scene, string path )
|
|||
else
|
||||
{
|
||||
LUPPP_NOTE("AudioBuffer set %i beats.", ab->getBeats() );
|
||||
|
||||
|
||||
std::string name = path;
|
||||
int i = name.find_last_of('/') + 1;
|
||||
std::string sub = name.substr( i );
|
||||
|
||||
ab->setName( sub.c_str() );
|
||||
|
||||
loadableBuffer = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( loadableBuffer )
|
||||
{
|
||||
std::string n = ab->getName();
|
||||
|
||||
// write audioBuffer to DSP
|
||||
EventLooperLoad e = EventLooperLoad( track, scene, ab );
|
||||
writeToDspRingbuffer( &e );
|
||||
|
||||
// now write audiobuffer name to GUI on track, scene
|
||||
gui->getTrack( track )->getClipSelector()->clipName( scene, n );
|
||||
|
||||
char* tmp = strdup( path.c_str() );
|
||||
lastLoadedSamplePath = dirname( tmp );
|
||||
free(tmp);
|
||||
|
|
|
@ -97,7 +97,7 @@ int main(int argc, char** argv)
|
|||
|
||||
// setup the testing Gui / JACK: Jack first, then GUI
|
||||
Jack::setup("LupppTEST");
|
||||
gui = new Gui(argv[0]);
|
||||
gui = new Gui( argv[0] );
|
||||
|
||||
// test offline functionality
|
||||
testResult += gui->getDiskReader()->runTests();
|
||||
|
|
Loading…
Add table
Reference in a new issue