Skip to content

Commit 9d35772

Browse files
committed
refactor includes and constants
1 parent 3eada15 commit 9d35772

16 files changed

+566
-512
lines changed

src/constants/controller_constants.h

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
// quantities
3+
#define DEFAULT_AUDIO_BUFFER_SIZE 33554432 // 2^25 (approx 3 min @ 48k)
4+
//#define DEFAULT_AUDIO_BUFFER_SIZE 25165824 // 1024 * 1024 * 24 (approx 135 sec @ 48k)
5+
//#define DEFAULT_AUDIO_BUFFER_SIZE 16777216 // 2^24 (approx 90 sec @ 48k)
6+
//#define DEFAULT_AUDIO_BUFFER_SIZE 8388608 // 2^23 (approx 45 sec @ 48k)
7+
//#define DEFAULT_AUDIO_BUFFER_SIZE 2097152 // 2^21 (approx 10 sec @ 48k)
8+
//#define DEFAULT_AUDIO_BUFFER_SIZE 1048576 // 2^20 (approx 5 sec @ 48k)
9+
#define NUM_SCENES 3
10+
#define NUM_LOOPS 9 // per scene
11+
#define LOOP_VOL_INC 0.1
12+
#if FIXED_N_AUDIO_PORTS
13+
# define N_IN_CHANNELS 4
14+
# define N_OUT_CHANNELS 2
15+
#else // FIXED_N_AUDIO_PORTS // TODO: implement setting N_*_CHANNELS via cmd line arg - GetTransientPeaks and updateVUMeters are especially brittle now
16+
# define MAX_INPUT_CHANNELS 2 // TODO: nyi - N_INPUT_CHANNELS currently used only used for memory check and scope cache
17+
# define MAX_OUTPUT_CHANNELS 2 // TODO: nyi - N_OUTPUT_CHANNELS currently used only for scope cache
18+
#endif // FIXED_N_AUDIO_PORTS
19+
#if SCENE_NFRAMES_EDITABLE
20+
# define BUFFER_MARGIN_SIZE SampleRate
21+
# define TRIGGER_LATENCY_SIZE 1280 // nFrames - kludge to compensate for keyboard delay - optimized for BufferSize <= 128
22+
# define MINIMUM_LOOP_DURATION 2 // nSeconds
23+
# if INIT_JACK_BEFORE_SCENES
24+
# if ALLOW_BUFFER_ROLLOVER
25+
# define INITIAL_END_FRAMEN (RecordBufferSize - nFramesPerPeriod)
26+
# else
27+
# define INITIAL_END_FRAMEN RecordBufferSize
28+
# endif // #if ALLOW_BUFFER_ROLLOVER
29+
# endif // #if INIT_JACK_BEFORE_SCENES
30+
#endif // #if SCENE_NFRAMES_EDITABLE
31+
#if DRAW_EDIT_HISTOGRAM
32+
# define N_PEAKS_FINE 720 // should be divisible into 360
33+
#else
34+
# define N_PEAKS_FINE 360 // should be divisible into 360
35+
#endif // #if DRAW_EDIT_HISTOGRAM
36+
#define PEAK_RADIUS 50 // TODO: PEAK_RADIUS and LOOP_DIAMETER are GUI specific - should probably be defined elsewhere
37+
#define LOOP_DIAMETER ((PEAK_RADIUS * 2) + 1)
38+
#define N_PEAKS_COURSE LOOP_DIAMETER
39+
40+
// string constants
41+
#define APP_NAME "Loopidity"
42+
//#define CONNECT_ARG "--connect"
43+
#define MONITOR_ARG "--nomon"
44+
#define SCENE_CHANGE_ARG "--noautoscenechange"
45+
#define JACK_NAME "loopidity"
46+
#define JACK_INPUT1_PORT_NAME "in1"
47+
#define JACK_INPUT2_PORT_NAME "in2"
48+
#define JACK_INPUT3_PORT_NAME "in3"
49+
#define JACK_INPUT4_PORT_NAME "in4"
50+
#define JACK_OUTPUT1_PORT_NAME "outL"
51+
#define JACK_OUTPUT2_PORT_NAME "outR"
52+
#define INVALID_METADATA_MSG "ERROR: Scene metadata state insane"
53+
//#define FREEMEM_FAIL_MSG "ERROR: Could not determine available memory - quitting"
54+
#define INSUFFICIENT_MEMORY_MSG "ERROR: Insufficient memory initializng buffers"
55+
#define JACK_SW_FAIL_MSG "ERROR: Could not register JACK client"
56+
#define JACK_HW_FAIL_MSG "ERROR: Could not open ports for JACK"
57+
#define OUT_OF_MEMORY_MSG "ERROR: Out of Memory"
58+
59+
// sdl user events
60+
#define EVT_NEW_LOOP 1
61+
#define EVT_SCENE_CHANGED 2
62+
63+
// error states
64+
#define JACK_INIT_SUCCESS 0
65+
#define JACK_MEM_FAIL 1
66+
#define JACK_SW_FAIL 2
67+
#define JACK_HW_FAIL 3

src/constants/feature_constants.h

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
// static features
3+
//#define INIT_LOOPIDITY 1
4+
#define INIT_JACK_BEFORE_SCENES 1
5+
#define WAIT_FOR_JACK_INIT 0
6+
#define FIXED_N_AUDIO_PORTS 1
7+
//#define MEMORY_CHECK 1 // if 0 choose DEFAULT_AUDIO_BUFFER_SIZE wisely
8+
#define FIXED_AUDIO_BUFFER_SIZE 0 // TODO: user defined/adjustable buffer sizes
9+
#define SCENE_NFRAMES_EDITABLE 1
10+
11+
// runtime features
12+
#define JACK_IO_READ_WRITE 1
13+
#define JACK_IO_COPY 1
14+
#define HANDLE_KEYBOARD_EVENTS 1
15+
#define HANDLE_MOUSE_EVENTS 0
16+
#define HANDLE_USER_EVENTS 1
17+
#define SCAN_LOOP_PEAKS 1
18+
#define SCAN_PEAKS 1
19+
#define DRAW_STATUS 1
20+
#define DRAW_SCENES 1
21+
#define DRAW_EDIT_HISTOGRAM SCENE_NFRAMES_EDITABLE && 1
22+
#define DRAW_SCOPES 1
23+
#define DRAW_VUS 1
24+
#define DRAW_DEBUG_TEXT 1
25+
#define AUTO_UNMUTE_LOOPS_ON_ROLLOVER 1
26+
27+
#if DRAW_STATUS
28+
# define DRAW_MODE 0
29+
/*
30+
# define UPDATE_MEMORY 0
31+
# define UPDATE_LOOP_PROGRESS 0
32+
# define UPDATE_VU 0
33+
# define VARDUMP 0
34+
*/
35+
#endif // #if DRAW_STATUS
36+
37+
#if DRAW_SCENES
38+
# define DRAW_SCENE_SCOPE 1
39+
# define DRAW_HISTOGRAMS 1
40+
# define DRAW_MUTED_HISTOGRAMS 1
41+
# define DRAW_PEAK_RINGS 1
42+
# define DRAW_LOOPS 1
43+
# define DRAW_MUTED_LOOPS 0
44+
# define DRAW_RECORDING_LOOP DRAW_LOOPS && 1
45+
# define DRAW_CURRENT_SCENE_INDICATOR 1
46+
#endif // #if DRAW_SCENES
47+
48+
#if DRAW_DEBUG_TEXT
49+
# include "../trace/trace.h"
50+
# define DRAW_DEBUG_TEXT_L Trace::SetDbgTextC() ;
51+
# define DRAW_DEBUG_TEXT_R Trace::SetDbgTextR() ;
52+
#else
53+
# define DRAW_DEBUG_TEXT_L ;
54+
# define DRAW_DEBUG_TEXT_R ;
55+
#endif // #if DRAW_DEBUG_TEXT
56+
57+
// Trace class features
58+
#define DEBUG_TRACE 1
59+
#define DEBUG_TRACE_JACK DEBUG_TRACE && 0
60+
#define DEBUG_TRACE_LOOPIDITY DEBUG_TRACE && 0
61+
#define DEBUG_TRACE_LOOPIDITYSDL DEBUG_TRACE && 0
62+
#define DEBUG_TRACE_SCENE DEBUG_TRACE && 0
63+
#define DEBUG_TRACE_SCENESDL DEBUG_TRACE && 0
64+
#define DEBUG_TRACE_CLASS DEBUG_TRACE && 0
65+
#define DEBUG_TRACE_EVS DEBUG_TRACE && 1
66+
#define DEBUG_TRACE_IN DEBUG_TRACE && 1
67+
#define DEBUG_TRACE_OUT DEBUG_TRACE && 1

src/constants/scene_constants.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
// magnitudes
3+
#define X_PADDING 10
4+
#define Y_PADDING 18
5+
#define BORDER_PAD 5
6+
#define HISTOGRAMS_H 17 // should be odd
7+
#define HISTOGRAMS_T (Y_PADDING - 2) // drawRecordingLoop() (offset from SCENE_T)
8+
#define HISTOGRAMS_B (HISTOGRAMS_T + HISTOGRAMS_H - 1) // ""
9+
#define HISTOGRAM_FRAMES_T (HISTOGRAMS_T - 1) // ""
10+
#define HISTOGRAM_FRAMES_B (HISTOGRAMS_B + 1) // ""
11+
#define HISTOGRAM_IMG_W 103 // (N_PEAKS_COURSE + 2) // drawHistogram() (offset from HISTOGRAMS_T)
12+
#define HISTOGRAM_IMG_H 19 // (HISTOGRAMS_H + 2) // ""
13+
#define HISTOGRAM_FRAME_R (N_PEAKS_COURSE + 1) // ""
14+
#define HISTOGRAM_FRAME_B (HISTOGRAMS_H + 1) // ""
15+
#define HISTOGRAM_PEAK_H (HISTOGRAMS_H / 2) // ""
16+
#define HISTOGRAM_0 HISTOGRAM_PEAK_H + 1 // ""
17+
#define LOOP_0 PEAK_RADIUS
18+
#define LOOP_W (X_PADDING + LOOP_DIAMETER)
19+
#define LOOPS_L 16
20+
#define LOOPS_T (HISTOGRAM_FRAMES_B + BORDER_PAD + 1)
21+
#define LOOPS_0 (LOOPS_T + PEAK_RADIUS + 1)
22+
#define LOOPS_B (LOOPS_T + LOOP_DIAMETER + 1)
23+
#define LOOP_FRAMES_T (HISTOGRAM_FRAMES_T - BORDER_PAD - 1)
24+
#define LOOP_FRAMES_B (LOOPS_B + BORDER_PAD + 1)
25+
#define SCENE_W 1000 // SCOPE_IMG is 1000x101
26+
#define SCENE_H ((Y_PADDING * 3) + HISTOGRAMS_H + LOOP_DIAMETER)
27+
#define SCENE_L (LOOPS_L - BORDER_PAD - 1)
28+
#define SCENE_R (SCENE_L + 999) // SCOPE_IMG is 1000x101 , LOOP_DIAMETER is 101 when PEAK_RADIUS is 50
29+
#define SCENE_T (HEADER_H + (BORDER_PAD * 2) + (SCENE_H * a_scene->getSceneN()))
30+
#define SCENE_B (SCENE_T + SCENE_H)
31+
#define SCENE_FRAME_L (SCENE_L - BORDER_PAD - 1)
32+
#define SCENE_FRAME_R (SCENE_R + BORDER_PAD + 1)
33+
#define SCENE_FRAME_T (SCENE_T + LOOP_FRAMES_T - BORDER_PAD - 1)
34+
#define SCENE_FRAME_B (SCENE_T + LOOP_FRAMES_B + BORDER_PAD + 1)
35+
#define SCENE_MASK_RECT { 0 , 0 , SCENE_W , 0 }
36+
#define SCENE_RECT { SCENE_L , 0 , 0 , 0 }
37+
#define HISTOGRAM_RECT { 0 , HISTOGRAM_FRAMES_T , 0 , 0 }
38+
#define HISTOGRAM_MASK_RECT { 0 , 0 , 1 , 0 }
39+
#define HISTOGRAM_GRADIENT_RECT { 0 , 0 , 0 , 0 }
40+
#define ROT_LOOP_IMG_RECT { 0 , 0 , 0 , 0 }
41+
#define PIE_SLICE_DEGREES (360.0 / (float)N_PEAKS_FINE)
42+
#define PIE_12_OCLOCK -90
43+
#define N_SECONDS_PER_HOUR 3600
44+
#define N_MINUTES_PER_HOUR 60
45+
#define N_SECONDS_PER_MINUTE 60
46+
47+
// colors
48+
#define SCOPE_PEAK_MAX_COLOR 0x800000FF
49+
#define SCOPE_PEAK_ZERO_COLOR 0x008000FF
50+
#define STATE_RECORDING_COLOR 0xFF0000FF
51+
#define STATE_PENDING_COLOR 0xFFFF00FF
52+
#define STATE_PLAYING_COLOR 0x00FF00FF
53+
#define STATE_IDLE_COLOR 0x808080FF
54+
#define PEAK_CURRENT_COLOR 0xFFFF00FF
55+
#define HISTOGRAM_PEAK_COLOR 0x008000FF
56+
#define LOOP_PEAK_MAX_COLOR 0x800000FF
57+
#define LOOP_IMG_MASK_COLOR 0xFFFFFFFF
58+
59+
// loop states
60+
#define STATE_LOOP_PLAYING 1
61+
#define STATE_LOOP_PENDING 2
62+
#define STATE_LOOP_MUTED 3

src/constants/view_constants.h

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
2+
// common
3+
#define GUIPAD 4
4+
#define GUIPAD2 (GUI_PAD * 2)
5+
6+
// timer intervals
7+
#define GUI_UPDATE_INTERVAL 125
8+
#define GUI_UPDATE_LOW_PRIORITY_NICE 8 // n high priority updates to pass
9+
10+
// window magnitudes
11+
#define SCREEN_W 1024 // minimum screen resolution
12+
#define SCREEN_H 768 // minimum screen resolution
13+
#define WIN_TITLE_H 20 // approximate window decoration size
14+
#define WIN_BORDER_W 2 // approximate window decoration size
15+
#define WIN_BORDER_H 2 // approximate window decoration size
16+
#define PIXEL_DEPTH 32
17+
#define WIN_W (SCREEN_W - (WIN_BORDER_W * 2))
18+
#define WIN_H (SCREEN_H - WIN_TITLE_H - WIN_BORDER_H)
19+
#define WIN_RECT { 0 , 0 , WIN_W , WIN_H }
20+
#define WIN_CENTER (WinRect.w / 2)
21+
22+
// header magnitudes
23+
#define HEADER_FONT_SIZE 36
24+
//#define HEADER_W 200 // approx 10 chars @ STATUS_FONT_SIZE 36
25+
#define HEADER_W 360 // approx 18 chars @ STATUS_FONT_SIZE 36
26+
#define HEADER_H 48 // HEADER_FONT_SIZE 36
27+
#define HEADER_X (WIN_CENTER - (HEADER_W / 2))
28+
#define HEADER_RECT_DIM { 0 , 0 , HEADER_W , HEADER_H }
29+
#define HEADER_RECT_C { (Sint16)HEADER_X , 0 , 0 , 0 }
30+
31+
// scope magnitudes
32+
#define N_PEAKS_SCOPE 420 // TODO: maybe set this to scene width/2
33+
#define SCOPE_W N_PEAKS_SCOPE
34+
#define SCOPES_H (PEAK_RADIUS * 2)
35+
#define SCOPEINL (WIN_CENTER + GUI_PAD)
36+
#define SCOPEOUTR (WIN_CENTER - GUI_PAD)
37+
#define SCOPEINR (SCOPE_IN_L + N_PEAKS_SCOPE)
38+
#define SCOPEOUTL (SCOPE_OUT_R - N_PEAKS_SCOPE)
39+
//#define SCOPES_T (WinRect.h - (STATUS_H * 2) - SCOPES_H)
40+
#define SCOPES_T (HEADER_H + Y_PADDING + (SCENE_H * N_SCENES))
41+
#define SCOPE_0 (SCOPES_T + (SCOPES_H / 2)) ;
42+
#define SCOPEPEAKH ((float)SCOPES_H / 2.0)
43+
#define SCOPE_IN_RECT { (Sint16)SCOPE_IN_L , (Sint16)SCOPES_T , SCOPE_W + 1 , SCOPES_H + 1 }
44+
#define SCOPE_OUT_RECT { (Sint16)SCOPE_OUT_L , (Sint16)SCOPES_T , SCOPE_W + 1 , SCOPES_H + 1 }
45+
#define SCOPE_MASK_RECT { 0 , 0 , 1 , 0 } ;
46+
#define SCOPE_RECT { 0 , 0 , 0 , 0 } ;
47+
#define SCOPE_LOUD 0.95
48+
#define SCOPE_OPTIMAL 0.8
49+
50+
// edit histogram
51+
#define EDITOR_RECT { (Sint16)SCOPE_OUT_L , (Sint16)SCOPES_T , SCOPE_W + 2 + GUI_PAD2 , SCOPES_H }
52+
53+
// VUs magnitudes
54+
#define VUW 12
55+
#define VUSH SCOPES_H
56+
#define VUSB SCOPES_T + SCOPES_H
57+
#define VUS_T SCOPES_T
58+
#if FIXED_N_AUDIO_PORTS
59+
# define VUS_IN_W (GUI_PAD + ((VU_W + GUI_PAD) * N_INPUT_CHANNELS ))
60+
# define VUS_OUT_W (GUI_PAD + ((VU_W + GUI_PAD) * N_OUTPUT_CHANNELS))
61+
#else // FIXED_N_AUDIO_PORTS // see loopidity.h
62+
# define VUS_IN_W (GUI_PAD + ((VU_W + GUI_PAD) * MAX_IN_CHANNELS ))
63+
# define VUS_OUT_W (GUI_PAD + ((VU_W + GUI_PAD) * MAX_OUT_CHANNELS))
64+
#endif // FIXED_N_AUDIO_PORTS
65+
#define VUSINL (SCOPE_IN_R + GUI_PAD2 )
66+
#define VUSOUTL (SCOPE_OUT_L - GUI_PAD - VUS_OUT_W)
67+
#define VUS_IN_RECT { (Sint16)VUS_IN_L , (Sint16)VUS_T , (Uint16)VUS_IN_W , VUS_H }
68+
#define VUS_OUT_RECT { (Sint16)VUS_OUT_L , (Sint16)VUS_T , (Uint16)VUS_OUT_W , VUS_H }
69+
#define VUS_MASK_RECT { 0 , 0 , VU_W , 0 } ;
70+
#define VU_RECT { 0 , 0 , 0 , 0 } ;
71+
72+
// status magnitudes
73+
#define STATUS_FONT_SIZE 12
74+
#define STATUS_H 20 // STATUS_FONT_SIZE 12
75+
#define STATUS_W 256 // approx 36 chars @ STATUS_FONT_SIZE 12
76+
#define STATUS_Y (WinRect.h - STATUS_H)
77+
#define STATUS_L 0
78+
#define STATUS_C ((WinRect.w / 2) - (STATUS_W / 2))
79+
#define STATUS_R (WinRect.w - STATUS_W)
80+
#define STATUS_RECT_DIM { 0 , 0 , STATUS_W , STATUS_H }
81+
#define STATUS_RECT_L { (Sint16)STATUS_L , (Sint16)STATUS_Y , 0 , 0 }
82+
#define STATUS_RECT_C { (Sint16)STATUS_C , (Sint16)STATUS_Y , 0 , 0 }
83+
#define STATUS_RECT_R { (Sint16)STATUS_R , (Sint16)STATUS_Y , 0 , 0 }
84+
85+
// mouse magnitudes
86+
#define MOUSE_SCENES_L (LOOPS_L - BORDER_PAD)
87+
#define MOUSE_SCENES_R (MOUSE_SCENES_L + (LOOP_W * N_LOOPS))
88+
#define MOUSE_SCENES_T (HEADER_H - (Y_PADDING / 2))
89+
#define MOUSE_SCENES_B (MOUSE_SCENES_T + (SCENE_H * N_SCENES))
90+
91+
// edit histogram magnitudes
92+
#if SCENE_NFRAMES_EDITABLE
93+
# define EDIT_HISTOGRAM_GRADUATIONS_GRANULARITY 500
94+
# define EDIT_HISTOGRAM_GRADUATION_H 12
95+
#endif // #if SCENE_NFRAMES_EDITABLE
96+
97+
// external assets
98+
#define SCOPE_IMG_PATH "scope_gradient.bmp"
99+
#define HISTOGRAM_IMG_PATH "histogram_gradient.bmp"
100+
#define LOOP_IMG_PATH "loop_gradient.argb.bmp"
101+
#define PURISA_TTF_PATH "Purisa.ttf"
102+
103+
// fonts and colors
104+
#define HEADER_FONT_PATH PURISA_TTF_PATH
105+
#define HEADER_TEXT_COLOR { 255 , 0 , 255 , 0 }
106+
#define STATUS_FONT_PATH PURISA_TTF_PATH
107+
#define STATUS_TEXT_COLOR { 255 , 0 , 255 , 0 }
108+
#define WINDOWBGCOLOR 0xFF111111
109+
#define VUSINBGCOLOR 0xFF221122
110+
#define VUSOUTBGCOLOR 0xFF112222 // NOTE: SDL_FillRect() takes 0xAARRGGBB
111+
#define VUSINBORDERCOLOR 0x882288FF // NOTE: roundedRectangleColor() takes 0xRRGGBBAA
112+
#define VUSOUTBORDERCOLOR 0x228888FF
113+
// #define INSCOPE_QUIET_COLOR 0x00ff00FF
114+
// #define INSCOPE_OPTIMAL_COLOR 0xFFFF00FF
115+
// #define INSCOPE_LOUD_COLOR 0xFF0000FF
116+
// #define OUTSCOPE_QUIET_COLOR 0x00FF00FF
117+
// #define OUTSCOPE_OPTIMAL_COLOR 0xFFFF00FF
118+
// #define OUTSCOPE_LOUD_COLOR 0xFF0000FF
119+
120+
// string constants
121+
#define HEADER_TEXT "This is Loopidity"
122+
#define X11_ERROR_MSG "ERROR: LoopiditySdl::Init(): XGetWindowAttributes(): can't get root window geometry - quitting\n"
123+
#define RESOLUTION_ERROR_MSG "ERROR: screen resolution must be at least %dx%d - quitting\n"
124+
#define SDL_ERROR_FMT "ERROR: %s(): %s\n"
125+
#define SDL_INIT_ERROR_TEXT "SDL_Init"
126+
#define SDL_SETVIDEOMODE_ERROR_TEXT "SDL_SetVideoMode"
127+
#define SDL_KEYREPEAT_ERROR_TEXT "SDL_EnableKeyRepeat"
128+
#define SDL_LOADBMP_ERROR_TEXT "SDL_LoadBMP"
129+
#define TTF_ERROR_FMT "ERROR: %s(): %s\n"
130+
#define TTF_INIT_ERROR_MSG "TTF_Init"
131+
#define TTF_OPENFONT_ERROR_MSG "TTF_OpenFont"
132+
133+
// flags
134+
#define SDL_SCREEN_FLAGS SDL_HWSURFACE | SDL_DOUBLEBUF

src/jack_io.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
|*| along with Loopidity. If not, see <http://www.gnu.org/licenses/>.
1818
\*/
1919

20-
20+
#include "constants/feature_constants.h"
2121
#include "jack_io.h"
22+
#include "constants/view_constants.h"
2223

2324

2425
/* JackIO class side public constants */
@@ -27,8 +28,8 @@
2728
const Uint8 JackIO::N_INPUT_CHANNELS = N_IN_CHANNELS ;
2829
const Uint8 JackIO::N_OUTPUT_CHANNELS = N_OUT_CHANNELS ;
2930
#else // FIXED_N_AUDIO_PORTS // see loopidity.h
30-
const Uint8 JackIO::MAX_INPUT_CHANNELS = MAX_INPUT_CHANNELS ;
31-
const Uint8 JackIO::MAX_OUTPUT_CHANNELS = MAX_OUTPUT_CHANNELS ;
31+
const Uint8 JackIO::MAX_INPUT_CHANNELS = MAX_IN_CHANNELS ;
32+
const Uint8 JackIO::MAX_OUTPUT_CHANNELS = MAX_OUT_CHANNELS ;
3233
// also pvt MAX_PORTS below
3334
#endif // FIXED_N_AUDIO_PORTS
3435

@@ -617,7 +618,7 @@ DEBUG_TRACE_JACK_PROCESS_CALLBACK_ROLLOVER
617618
// TODO: adjustable loop seams (issue #14)
618619

619620
// copy audio samples - (see note on RecordBuffer layout in jack_io.h)
620-
if ((NewLoopEventLoop = new (nothrow) Loop(nFrames + BufferMarginsSize)))
621+
if ((NewLoopEventLoop = new (std::nothrow) Loop(nFrames + BufferMarginsSize)))
621622
{
622623
DEBUG_TRACE_JACK_PROCESS_CALLBACK_NEW_LOOP
623624

src/jack_io.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222
#define _JACK_IO_H_
2323

2424

25+
#include <jack/jack.h>
26+
#include <SDL/SDL.h>
27+
2528
#include "loopidity.h"
2629

30+
class Loop ;
31+
class Scene ;
32+
2733

2834
class JackIO
2935
{
@@ -90,7 +96,7 @@ class JackIO
9096
#endif // #if FIXED_N_AUDIO_PORTS
9197

9298
// event structs
93-
static SDL_Event NewLoopEvent ;
99+
static SDL_Event NewLoopEvent ;
94100
static Uint32 NewLoopEventSceneN ;
95101
static Loop* NewLoopEventLoop ;
96102
static SDL_Event SceneChangeEvent ;

0 commit comments

Comments
 (0)