diff core/RTAudio.cpp @ 303:421a69d42943 prerelease

Changed BeagleRT -> Bela in defines and thread names; some preliminary mux capelet stuff
author andrewm
date Fri, 27 May 2016 17:40:44 +0100
parents e4392164b458
children ff5f346a293e
line wrap: on
line diff
--- a/core/RTAudio.cpp	Fri May 27 17:28:24 2016 +0100
+++ b/core/RTAudio.cpp	Fri May 27 17:40:44 2016 +0100
@@ -51,12 +51,12 @@
 	bool autoSchedule;
 } InternalAuxiliaryTask;
 
-const char gRTAudioThreadName[] = "beaglert-audio";
-const char gRTAudioInterruptName[] = "beaglert-pru-irq";
+const char gRTAudioThreadName[] = "bela-audio";
+const char gRTAudioInterruptName[] = "bela-pru-irq";
 
 // Real-time tasks and objects
 RT_TASK gRTAudioThread;
-#ifdef BEAGLERT_USE_XENOMAI_INTERRUPTS
+#ifdef BELA_USE_XENOMAI_INTERRUPTS
 RT_INTR gRTAudioInterrupt;
 #endif
 PRU *gPRU = 0;
@@ -199,9 +199,9 @@
 
 	// Set flags based on init settings
 	if(settings->interleave)
-		gContext.flags |= BEAGLERT_FLAG_INTERLEAVED;
+		gContext.flags |= BELA_FLAG_INTERLEAVED;
 	if(settings->analogOutputsPersist)
-		gContext.flags |= BEAGLERT_FLAG_ANALOG_OUTPUTS_PERSIST;
+		gContext.flags |= BELA_FLAG_ANALOG_OUTPUTS_PERSIST;
 
 	// Use PRU for audio
 	gPRU = new PRU(&gContext);
@@ -285,7 +285,7 @@
 				}
 			}
 
-#ifdef BEAGLERT_USE_XENOMAI_INTERRUPTS
+#ifdef BELA_USE_XENOMAI_INTERRUPTS
 			gPRU->loop(&gRTAudioInterrupt, gUserData);
 #else
 			gPRU->loop(0, gUserData);
@@ -303,7 +303,7 @@
 }
 
 // Create a calculation loop which can run independently of the audio, at a different
-// (equal or lower) priority. Audio priority is defined in BEAGLERT_AUDIO_PRIORITY;
+// (equal or lower) priority. Audio priority is defined in BELA_AUDIO_PRIORITY;
 // priority should be generally be less than this.
 // Returns an (opaque) pointer to the created task on success; 0 on failure
 AuxiliaryTask Bela_createAuxiliaryTask(void (*functionToCall)(void* args), int priority, const char *name, void* args, bool autoSchedule)
@@ -427,12 +427,12 @@
 int Bela_startAudio()
 {
 	// Create audio thread with high Xenomai priority
-	if(rt_task_create(&gRTAudioThread, gRTAudioThreadName, 0, BEAGLERT_AUDIO_PRIORITY, T_JOINABLE | T_FPU)) {
+	if(rt_task_create(&gRTAudioThread, gRTAudioThreadName, 0, BELA_AUDIO_PRIORITY, T_JOINABLE | T_FPU)) {
 		  cout << "Error: unable to create Xenomai audio thread" << endl;
 		  return -1;
 	}
 
-#ifdef BEAGLERT_USE_XENOMAI_INTERRUPTS
+#ifdef BELA_USE_XENOMAI_INTERRUPTS
 	// Create an interrupt which the audio thread receives from the PRU
 	int result = 0;
 	if((result = rt_intr_create(&gRTAudioInterrupt, gRTAudioInterruptName, PRU_RTAUDIO_IRQ, I_NOAUTOENA)) != 0) {
@@ -502,7 +502,7 @@
 	getAuxTasks().clear();
 
 	// Delete the audio task and its interrupt
-#ifdef BEAGLERT_USE_XENOMAI_INTERRUPTS
+#ifdef BELA_USE_XENOMAI_INTERRUPTS
 	rt_intr_delete(&gRTAudioInterrupt);
 #endif
 	rt_task_delete(&gRTAudioThread);