@@ -13,11 +13,11 @@ use super::host::ClapHost;
13
13
use crate :: buffers:: { BufferData , BufferType , Buffers } ;
14
14
use crate :: bus:: { BusDir , Format } ;
15
15
use crate :: editor:: Editor ;
16
+ use crate :: engine:: { Config , Engine } ;
16
17
use crate :: events:: { Data , Event , Events } ;
17
18
use crate :: host:: Host ;
18
19
use crate :: params:: { ParamId , ParamInfo , ParamValue } ;
19
20
use crate :: plugin:: { Plugin , PluginInfo } ;
20
- use crate :: process:: { Config , Processor } ;
21
21
use crate :: sync:: param_gestures:: { GestureStates , GestureUpdate , ParamGestures } ;
22
22
use crate :: sync:: params:: ParamValues ;
23
23
use crate :: util:: { copy_cstring, slice_from_raw_parts_checked, DisplayParam } ;
@@ -57,7 +57,7 @@ pub struct ProcessState<P: Plugin> {
57
57
buffer_data : Vec < BufferData > ,
58
58
buffer_ptrs : Vec < * mut f32 > ,
59
59
events : Vec < Event > ,
60
- processor : Option < P :: Processor > ,
60
+ engine : Option < P :: Engine > ,
61
61
}
62
62
63
63
#[ repr( C ) ]
@@ -69,10 +69,10 @@ pub struct Instance<P: Plugin> {
69
69
pub input_bus_map : Vec < usize > ,
70
70
pub output_bus_map : Vec < usize > ,
71
71
pub param_map : Arc < HashMap < ParamId , usize > > ,
72
- // Processor -> plugin parameter changes
72
+ // Engine -> plugin parameter changes
73
73
pub plugin_params : ParamValues ,
74
- // Plugin -> processor parameter changes
75
- pub processor_params : ParamValues ,
74
+ // Plugin -> engine parameter changes
75
+ pub engine_params : ParamValues ,
76
76
pub param_gestures : Arc < ParamGestures > ,
77
77
pub main_thread_state : UnsafeCell < MainThreadState < P > > ,
78
78
pub process_state : UnsafeCell < ProcessState < P > > ,
@@ -125,7 +125,7 @@ impl<P: Plugin> Instance<P> {
125
125
output_bus_map,
126
126
param_map : Arc :: new ( param_map) ,
127
127
plugin_params : ParamValues :: with_count ( info. params . len ( ) ) ,
128
- processor_params : ParamValues :: with_count ( info. params . len ( ) ) ,
128
+ engine_params : ParamValues :: with_count ( info. params . len ( ) ) ,
129
129
param_gestures : Arc :: new ( ParamGestures :: with_count ( info. params . len ( ) ) ) ,
130
130
main_thread_state : UnsafeCell :: new ( MainThreadState {
131
131
host_params : None ,
@@ -138,7 +138,7 @@ impl<P: Plugin> Instance<P> {
138
138
buffer_data : Vec :: new ( ) ,
139
139
buffer_ptrs : Vec :: new ( ) ,
140
140
events : Vec :: with_capacity ( 4096 ) ,
141
- processor : None ,
141
+ engine : None ,
142
142
} ) ,
143
143
}
144
144
}
@@ -154,8 +154,8 @@ impl<P: Plugin> Instance<P> {
154
154
}
155
155
}
156
156
157
- fn sync_processor ( & self , events : & mut Vec < Event > ) {
158
- for ( index, value) in self . processor_params . poll ( ) {
157
+ fn sync_engine ( & self , events : & mut Vec < Event > ) {
158
+ for ( index, value) in self . engine_params . poll ( ) {
159
159
events. push ( Event {
160
160
time : 0 ,
161
161
data : Data :: ParamChange {
@@ -357,11 +357,11 @@ impl<P: Plugin> Instance<P> {
357
357
max_buffer_size : max_frames_count as usize ,
358
358
} ;
359
359
360
- // Discard any pending plugin -> processor parameter changes, since they will already be
361
- // reflected in the initial state of the processor .
362
- for _ in instance. processor_params . poll ( ) { }
360
+ // Discard any pending plugin -> engine parameter changes, since they will already be
361
+ // reflected in the initial state of the engine .
362
+ for _ in instance. engine_params . poll ( ) { }
363
363
364
- process_state. processor = Some ( main_thread_state. plugin . processor ( config) ) ;
364
+ process_state. engine = Some ( main_thread_state. plugin . engine ( config) ) ;
365
365
366
366
true
367
367
}
@@ -371,11 +371,11 @@ impl<P: Plugin> Instance<P> {
371
371
let main_thread_state = & mut * instance. main_thread_state . get ( ) ;
372
372
let process_state = & mut * instance. process_state . get ( ) ;
373
373
374
- // Apply any remaining processor -> plugin parameter changes. There won't be any more until
374
+ // Apply any remaining engine -> plugin parameter changes. There won't be any more until
375
375
// the next call to `activate`.
376
376
instance. sync_plugin ( main_thread_state) ;
377
377
378
- process_state. processor = None ;
378
+ process_state. engine = None ;
379
379
}
380
380
381
381
unsafe extern "C" fn start_processing ( _plugin : * const clap_plugin ) -> bool {
@@ -388,16 +388,16 @@ impl<P: Plugin> Instance<P> {
388
388
let instance = & * ( plugin as * const Self ) ;
389
389
let process_state = & mut * instance. process_state . get ( ) ;
390
390
391
- if let Some ( processor ) = & mut process_state. processor {
392
- // Flush plugin -> processor parameter changes
391
+ if let Some ( engine ) = & mut process_state. engine {
392
+ // Flush plugin -> engine parameter changes
393
393
process_state. events . clear ( ) ;
394
- instance. sync_processor ( & mut process_state. events ) ;
394
+ instance. sync_engine ( & mut process_state. events ) ;
395
395
396
396
if !process_state. events . is_empty ( ) {
397
- processor . flush ( Events :: new ( & process_state. events ) ) ;
397
+ engine . flush ( Events :: new ( & process_state. events ) ) ;
398
398
}
399
399
400
- processor . reset ( ) ;
400
+ engine . reset ( ) ;
401
401
}
402
402
}
403
403
@@ -408,7 +408,7 @@ impl<P: Plugin> Instance<P> {
408
408
let instance = & * ( plugin as * const Self ) ;
409
409
let process_state = & mut * instance. process_state . get ( ) ;
410
410
411
- let Some ( processor ) = & mut process_state. processor else {
411
+ let Some ( engine ) = & mut process_state. engine else {
412
412
return CLAP_PROCESS_ERROR ;
413
413
} ;
414
414
@@ -471,7 +471,7 @@ impl<P: Plugin> Instance<P> {
471
471
}
472
472
473
473
process_state. events . clear ( ) ;
474
- instance. sync_processor ( & mut process_state. events ) ;
474
+ instance. sync_engine ( & mut process_state. events ) ;
475
475
instance. process_param_events ( process. in_events , & mut process_state. events ) ;
476
476
477
477
let last_sample = process. frames_count . saturating_sub ( 1 ) ;
@@ -482,7 +482,7 @@ impl<P: Plugin> Instance<P> {
482
482
last_sample,
483
483
) ;
484
484
485
- processor . process (
485
+ engine . process (
486
486
Buffers :: from_raw_parts (
487
487
& process_state. buffer_data ,
488
488
& process_state. buffer_ptrs ,
@@ -800,9 +800,9 @@ impl<P: Plugin> Instance<P> {
800
800
let process_state = & mut * instance. process_state . get ( ) ;
801
801
802
802
// If we are in the active state, flush will be called on the audio thread.
803
- if let Some ( processor ) = & mut process_state. processor {
803
+ if let Some ( engine ) = & mut process_state. engine {
804
804
process_state. events . clear ( ) ;
805
- instance. sync_processor ( & mut process_state. events ) ;
805
+ instance. sync_engine ( & mut process_state. events ) ;
806
806
instance. process_param_events ( in_, & mut process_state. events ) ;
807
807
instance. process_gestures (
808
808
& mut process_state. gesture_states ,
@@ -811,7 +811,7 @@ impl<P: Plugin> Instance<P> {
811
811
0 ,
812
812
) ;
813
813
814
- processor . flush ( Events :: new ( & process_state. events ) ) ;
814
+ engine . flush ( Events :: new ( & process_state. events ) ) ;
815
815
}
816
816
// Otherwise, flush will be called on the main thread.
817
817
else {
@@ -933,7 +933,7 @@ impl<P: Plugin> Instance<P> {
933
933
if main_thread_state. plugin . load ( & mut StreamReader ( stream) ) . is_ok ( ) {
934
934
for ( index, param) in instance. info . params . iter ( ) . enumerate ( ) {
935
935
let value = main_thread_state. plugin . get_param ( param. id ) ;
936
- instance. processor_params . set ( index, value) ;
936
+ instance. engine_params . set ( index, value) ;
937
937
938
938
if let Some ( editor) = & mut main_thread_state. editor {
939
939
editor. param_changed ( param. id , value) ;
0 commit comments