Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

853 lines
21KB

  1. /*******************************************************************************/
  2. /* Copyright (C) 2009 Jonathan Moore Liles */
  3. /* */
  4. /* This program is free software; you can redistribute it and/or modify it */
  5. /* under the terms of the GNU General Public License as published by the */
  6. /* Free Software Foundation; either version 2 of the License, or (at your */
  7. /* option) any later version. */
  8. /* */
  9. /* This program is distributed in the hope that it will be useful, but WITHOUT */
  10. /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
  11. /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
  12. /* more details. */
  13. /* */
  14. /* You should have received a copy of the GNU General Public License along */
  15. /* with This program; see the file COPYING. If not,write to the Free Software */
  16. /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  17. /*******************************************************************************/
  18. #include "const.h"
  19. #include "Controller_Module.H"
  20. #include <stdio.h>
  21. #include <FL/Fl.H>
  22. #include <FL/Fl_Box.H>
  23. #include <FL/fl_ask.H>
  24. #include <FL/Fl_Counter.H>
  25. #include <FL/Fl_Menu_Item.H>
  26. #include <FL/Fl_Menu_Button.H>
  27. #include <FL/Fl_Menu_.H>
  28. #include <FL/Fl_Light_Button.H>
  29. #include <FL/fl_draw.H>
  30. #include "FL/Fl_DialX.H"
  31. #include "FL/Fl_Labelpad_Group.H"
  32. #include "FL/Fl_Value_SliderX.H"
  33. #include "Panner.H"
  34. #include "FL/test_press.H"
  35. #include "FL/menu_popup.H"
  36. #include "Engine/Engine.H"
  37. #include "Chain.H"
  38. #include "OSC/Endpoint.H"
  39. // needed for mixer->endpoint
  40. #include "Mixer.H"
  41. #include "string_util.h"
  42. bool Controller_Module::learn_by_number = false;
  43. bool Controller_Module::_learn_mode = false;
  44. Controller_Module::Controller_Module ( bool is_default ) : Module( is_default, 50, 100, name() )
  45. {
  46. // label( "" );
  47. box( FL_NO_BOX );
  48. _pad = true;
  49. control = 0;
  50. control_value =0.0f;
  51. add_port( Port( this, Port::OUTPUT, Port::CONTROL ) );
  52. _mode = GUI;
  53. // mode( GUI );
  54. // mode( CV );
  55. // configure_inputs( 1 );
  56. end();
  57. log_create();
  58. }
  59. Controller_Module::~Controller_Module ( )
  60. {
  61. log_destroy();
  62. /* shutdown JACK port, if we have one */
  63. mode( GUI );
  64. }
  65. void
  66. Controller_Module::handle_chain_name_changed()
  67. {
  68. // change_osc_path( generate_osc_path() );
  69. }
  70. void
  71. Controller_Module::disconnect ( void )
  72. {
  73. for ( std::vector<Module::Port>::iterator i = control_output.begin();
  74. i != control_output.end();
  75. ++i )
  76. {
  77. (*i).disconnect();
  78. }
  79. }
  80. void
  81. Controller_Module::get ( Log_Entry &e ) const
  82. {
  83. Module::get( e );
  84. Port *p = control_output[0].connected_port();
  85. if ( !p )
  86. {
  87. e.add( ":module", "" );
  88. e.add( ":port", "" );
  89. e.add( ":mode", "" );
  90. }
  91. else
  92. {
  93. Module *m = p->module();
  94. e.add( ":module", m );
  95. e.add( ":port", m->control_input_port_index( p ) );
  96. e.add( ":mode", mode() );
  97. }
  98. }
  99. void
  100. Controller_Module::set ( Log_Entry &e )
  101. {
  102. Module::set( e );
  103. int port = -1;
  104. Module *module = NULL;
  105. for ( int i = 0; i < e.size(); ++i )
  106. {
  107. const char *s, *v;
  108. e.get( i, &s, &v );
  109. if ( ! strcmp( s, ":port" ) )
  110. {
  111. port = atoi( v );
  112. }
  113. else if ( ! strcmp( s, ":module" ) )
  114. {
  115. int i;
  116. sscanf( v, "%X", &i );
  117. Module *t = (Module*)Loggable::find( i );
  118. assert( t );
  119. module = t;
  120. }
  121. }
  122. if ( port >= 0 && module )
  123. {
  124. connect_to( &module->control_input[port] );
  125. module->chain()->add_control( this );
  126. label( module->control_input[port].name() );
  127. }
  128. for ( int i = 0; i < e.size(); ++i )
  129. {
  130. const char *s, *v;
  131. e.get( i, &s, &v );
  132. if ( ! strcmp( s, ":mode" ) )
  133. {
  134. mode( (Mode)atoi( v ) );
  135. }
  136. }
  137. }
  138. void
  139. Controller_Module::mode ( Mode m )
  140. {
  141. if( mode() != CV && m == CV )
  142. {
  143. if ( control_output[0].connected() )
  144. {
  145. chain()->engine()->lock();
  146. Port *p = control_output[0].connected_port();
  147. JACK::Port po( chain()->engine(), JACK::Port::Input, JACK::Port::Audio, p->name(), 0, "CV" );
  148. if ( ! po.activate() )
  149. {
  150. fl_alert( "Could not activate JACK port \"%s\"", po.name() );
  151. chain()->engine()->unlock();
  152. return;
  153. }
  154. if ( po.valid() )
  155. {
  156. jack_input.push_back( po );
  157. }
  158. chain()->engine()->unlock();
  159. }
  160. }
  161. else if ( mode() == CV && m != CV )
  162. {
  163. chain()->engine()->lock();
  164. jack_input.back().shutdown();
  165. jack_input.pop_back();
  166. chain()->engine()->unlock();
  167. }
  168. _mode = m ;
  169. }
  170. /** attempt to transform this controller into a spatialization
  171. controller and connect to the given module's spatialization
  172. control inputs. Returns true on success, false if given module
  173. does not accept spatialization inputs. */
  174. bool
  175. Controller_Module::connect_spatializer_to ( Module *m )
  176. {
  177. /* these are for detecting related parameter groups which can be
  178. better represented by a single control */
  179. Port *azimuth_port = NULL;
  180. float azimuth_value = 0.0f;
  181. Port *elevation_port = NULL;
  182. float elevation_value = 0.0f;
  183. for ( unsigned int i = 0; i < m->control_input.size(); ++i )
  184. {
  185. Port *p = &m->control_input[i];
  186. if ( !strcasecmp( "Azimuth", p->name() ) &&
  187. 180.0f == p->hints.maximum &&
  188. -180.0f == p->hints.minimum )
  189. {
  190. azimuth_port = p;
  191. azimuth_value = p->control_value();
  192. continue;
  193. }
  194. else if ( !strcasecmp( "Elevation", p->name() ) &&
  195. 90.0f == p->hints.maximum &&
  196. -90.0f == p->hints.minimum )
  197. {
  198. elevation_port = p;
  199. elevation_value = p->control_value();
  200. continue;
  201. }
  202. }
  203. if ( ! ( azimuth_port && elevation_port ) )
  204. return false;
  205. control_output.clear();
  206. add_port( Port( this, Port::OUTPUT, Port::CONTROL ) );
  207. add_port( Port( this, Port::OUTPUT, Port::CONTROL ) );
  208. control_output[0].connect_to( azimuth_port );
  209. control_output[1].connect_to( elevation_port );
  210. {
  211. clear();
  212. Panner *o = new Panner( 0,0, 92,92 );
  213. o->box(FL_FLAT_BOX);
  214. o->color(FL_GRAY0);
  215. o->selection_color(FL_BACKGROUND_COLOR);
  216. o->labeltype(FL_NORMAL_LABEL);
  217. o->labelfont(0);
  218. o->labelcolor(FL_FOREGROUND_COLOR);
  219. o->align(FL_ALIGN_TOP);
  220. o->when(FL_WHEN_CHANGED);
  221. label( "Spatialization" );
  222. o->align(FL_ALIGN_TOP);
  223. o->labelsize( 10 );
  224. // o->callback( cb_panner_value_handle, new callback_data( this, azimuth_port_number, elevation_port_number ) );
  225. o->point( 0 )->azimuth( azimuth_value );
  226. o->point( 0 )->elevation( elevation_value );
  227. o->callback( cb_spatializer_handle, this );
  228. control = (Fl_Valuator*)o;
  229. if ( _pad )
  230. {
  231. Fl_Labelpad_Group *flg = new Fl_Labelpad_Group( o );
  232. flg->position( x(), y() );
  233. flg->set_visible_focus();
  234. size( flg->w(), flg->h() );
  235. add( flg );
  236. }
  237. else
  238. {
  239. o->resize( x(), y(), w(), h() );
  240. add( o );
  241. resizable( o );
  242. init_sizes();
  243. }
  244. _type = SPATIALIZATION;
  245. return true;
  246. }
  247. }
  248. void
  249. Controller_Module::connect_to ( Port *p )
  250. {
  251. control_output[0].connect_to( p );
  252. clear();
  253. Fl_Widget *w;
  254. if ( p->hints.type == Module::Port::Hints::BOOLEAN )
  255. {
  256. Fl_Light_Button *o = new Fl_Light_Button( 0, 0, 40, 40, p->name() );
  257. w = o;
  258. o->value( p->control_value() );
  259. _type = TOGGLE;
  260. /* FIXME: hack */
  261. control = (Fl_Valuator*)o;
  262. }
  263. else if ( p->hints.type == Module::Port::Hints::INTEGER )
  264. {
  265. Fl_Counter *o = new Fl_Counter(0, 0, 58, 24, p->name() );
  266. control = o;
  267. w = o;
  268. o->type(1);
  269. o->step(1);
  270. if ( p->hints.ranged )
  271. {
  272. o->minimum( p->hints.minimum );
  273. o->maximum( p->hints.maximum );
  274. }
  275. _type = SPINNER;
  276. o->value( p->control_value() );
  277. }
  278. else if ( p->hints.type == Module::Port::Hints::LOGARITHMIC )
  279. {
  280. Fl_Value_SliderX *o = new Fl_Value_SliderX(0, 0, 30, 250, p->name() );
  281. control = o;
  282. w = o;
  283. o->type(4);
  284. o->color( FL_BACKGROUND2_COLOR );
  285. o->selection_color( fl_color_average( FL_GRAY, FL_CYAN, 0.5 ) );
  286. o->minimum(1.5);
  287. o->maximum(0);
  288. o->value(1);
  289. o->textsize(9);
  290. if ( p->hints.ranged )
  291. {
  292. o->minimum( p->hints.maximum );
  293. o->maximum( p->hints.minimum );
  294. }
  295. o->value( p->control_value() );
  296. _type = SLIDER;
  297. }
  298. else
  299. {
  300. { Fl_DialX *o = new Fl_DialX( 0, 0, 50, 50, p->name() );
  301. w = o;
  302. control = o;
  303. if ( p->hints.ranged )
  304. {
  305. DMESSAGE( "Min: %f, max: %f", p->hints.minimum, p->hints.maximum );
  306. o->minimum( p->hints.minimum );
  307. o->maximum( p->hints.maximum );
  308. }
  309. o->color( fl_darker( FL_GRAY ) );
  310. o->selection_color( FL_WHITE );
  311. o->value( p->control_value() );
  312. }
  313. _type = KNOB;
  314. }
  315. control_value = p->control_value();
  316. w->set_visible_focus();
  317. w->align(FL_ALIGN_TOP);
  318. w->labelsize( 10 );
  319. w->callback( cb_handle, this );
  320. if ( _pad )
  321. {
  322. Fl_Labelpad_Group *flg = new Fl_Labelpad_Group( w );
  323. flg->set_visible_focus();
  324. size( flg->w(), flg->h() );
  325. flg->position( x(), y() );
  326. add( flg );
  327. }
  328. else
  329. {
  330. /* HACK: hide label */
  331. w->labeltype( FL_NO_LABEL );
  332. w->resize( x(), y(), this->w(), h() );
  333. add( w );
  334. resizable( w );
  335. // init_sizes();
  336. }
  337. }
  338. void
  339. Controller_Module::update ( void )
  340. {
  341. /* we only need this in CV (JACK) mode, because with other forms
  342. * of control the change happens in the GUI thread and we know it */
  343. if ( mode() != CV )
  344. return;
  345. /* ensures that port value change callbacks are run */
  346. if ( control && control_output.size() > 0 && control_output[0].connected() )
  347. control_output[0].connected_port()->control_value( control_value );
  348. }
  349. void
  350. Controller_Module::cb_handle ( Fl_Widget *w, void *v )
  351. {
  352. ((Controller_Module*)v)->cb_handle( w );
  353. }
  354. void
  355. Controller_Module::cb_handle ( Fl_Widget *w )
  356. {
  357. if ( type() == TOGGLE )
  358. {
  359. control_value = ((Fl_Button*)w)->value();
  360. }
  361. else
  362. control_value = ((Fl_Valuator*)w)->value();
  363. if ( control_output[0].connected() )
  364. control_output[0].connected_port()->control_value( control_value );
  365. }
  366. void
  367. Controller_Module::cb_spatializer_handle ( Fl_Widget *w, void *v )
  368. {
  369. ((Controller_Module*)v)->cb_spatializer_handle( w );
  370. }
  371. void
  372. Controller_Module::cb_spatializer_handle ( Fl_Widget *w )
  373. {
  374. Panner *pan = (Panner*)w;
  375. if ( control_output[0].connected() &&
  376. control_output[1].connected() )
  377. {
  378. control_output[0].connected_port()->control_value( pan->point( 0 )->azimuth() );
  379. control_output[1].connected_port()->control_value( pan->point( 0 )->elevation() );
  380. }
  381. }
  382. void
  383. Controller_Module::menu_cb ( Fl_Widget *w, void *v )
  384. {
  385. ((Controller_Module*)v)->menu_cb( (Fl_Menu_*) w );
  386. }
  387. void
  388. Controller_Module::menu_cb ( const Fl_Menu_ *m )
  389. {
  390. char picked[256];
  391. m->item_pathname( picked, sizeof( picked ) );
  392. Logger log( this );
  393. if ( ! strcmp( picked, "Mode/GUI + OSC" ) )
  394. mode( GUI );
  395. else if ( ! strcmp( picked, "Mode/Control Voltage (JACK)" ) )
  396. mode( CV );
  397. else if ( ! strcmp( picked, "/Remove" ) )
  398. command_remove();
  399. else if ( ! strncmp( picked, "Connect To/", strlen( "Connect To/" ) ) )
  400. {
  401. char *peer_name = index( picked, '/' ) + 1;
  402. *index( peer_name, '/' ) = 0;
  403. // OSC::Signal s = (OSC::Signal*)m->mvalue()->user_data();
  404. const char *path = ((OSC::Signal*)m->mvalue()->user_data())->path();
  405. /* if ( ! _osc_output()->is_connected_to( ((OSC::Signal*)m->mvalue()->user_data()) ) ) */
  406. /* { */
  407. /* _persistent_osc_connections.push_back( strdup(path) ); */
  408. Port *p = control_output[0].connected_port();
  409. if ( learn_by_number )
  410. mixer->osc_endpoint->add_translation( path, p->osc_number_path());
  411. else
  412. mixer->osc_endpoint->add_translation( path, p->osc_path() );
  413. }
  414. else if ( ! strncmp( picked, "Disconnect From/", strlen( "Disconnect From/" ) ) )
  415. {
  416. /* char *peer_name = index( picked, '/' ) + 1; */
  417. /* *index( peer_name, '/' ) = 0; */
  418. // OSC::Signal s = (OSC::Signal*)m->mvalue()->user_data();
  419. const char *path = (const char*)m->mvalue()->user_data();
  420. /* if ( ! _osc_output()->is_connected_to( ((OSC::Signal*)m->mvalue()->user_data()) ) ) */
  421. /* { */
  422. /* _persistent_osc_connections.push_back( strdup(path) ); */
  423. // Port *p = control_output[0].connected_port();
  424. mixer->osc_endpoint->del_translation( path );
  425. /* if ( learn_by_number ) */
  426. /* { */
  427. /* char *our_path = p->osc_number_path(); */
  428. /* mixer->osc_endpoint->add_translation( path, our_path ); */
  429. /* free(our_path); */
  430. /* } */
  431. /* else */
  432. /* mixer->osc_endpoint->add_translation( path, p->osc_path() ); */
  433. }
  434. /* } */
  435. /* else */
  436. /* { */
  437. /* /\* timeline->osc->disconnect_signal( _osc_output(), path ); *\/ */
  438. /* /\* for ( std::list<char*>::iterator i = _persistent_osc_connections.begin(); *\/ */
  439. /* /\* i != _persistent_osc_connections.end(); *\/ */
  440. /* /\* ++i ) *\/ */
  441. /* /\* { *\/ */
  442. /* /\* if ( !strcmp( *i, path ) ) *\/ */
  443. /* /\* { *\/ */
  444. /* /\* free( *i ); *\/ */
  445. /* /\* i = _persistent_osc_connections.erase( i ); *\/ */
  446. /* /\* break; *\/ */
  447. /* /\* } *\/ */
  448. /* /\* } *\/ */
  449. /* //free( path ); */
  450. /* } */
  451. }
  452. static Fl_Menu_Button *peer_menu;
  453. static const char *peer_prefix;
  454. void
  455. Controller_Module::peer_callback( OSC::Signal *sig, OSC::Signal::State state, void *v )
  456. {
  457. char *s;
  458. DMESSAGE( "Paramter limits: %f %f", sig->parameter_limits().min, sig->parameter_limits().max );
  459. /* only show outputs */
  460. if ( sig->direction() != OSC::Signal::Output )
  461. return;
  462. /* only list CV signals for now */
  463. if ( ! ( sig->parameter_limits().min == 0.0 &&
  464. sig->parameter_limits().max == 1.0 ) )
  465. return;
  466. if ( ! v )
  467. {
  468. /* if( state == OSC::Signal::Created ) */
  469. /* timeline->connect_osc(); */
  470. /* else */
  471. /* timeline->update_osc_connection_state(); */
  472. }
  473. else
  474. {
  475. /* building menu */
  476. // const char *name = sig->peer_name();
  477. assert( sig->path() );
  478. char *path = strdup( sig->path() );
  479. unescape_url( path );
  480. asprintf( &s, "%s/%s", peer_prefix, path );
  481. peer_menu->add( s, 0, NULL, (void*)( sig ), 0 );
  482. /* FL_MENU_TOGGLE | */
  483. /* ( ((Controller_Module*)v)->_osc_output()->is_connected_to( sig ) ? FL_MENU_VALUE : 0 ) ); */
  484. free( path );
  485. free( s );
  486. }
  487. }
  488. void
  489. Controller_Module::add_osc_peers_to_menu ( Fl_Menu_Button *m, const char *prefix )
  490. {
  491. mixer->osc_endpoint->peer_signal_notification_callback( &Controller_Module::peer_callback, NULL );
  492. peer_menu = m;
  493. peer_prefix = prefix;
  494. mixer->osc_endpoint->list_peer_signals( this );
  495. }
  496. void
  497. Controller_Module::add_osc_connections_to_menu ( Fl_Menu_Button *m, const char *prefix )
  498. {
  499. /* peer_menu = m; */
  500. const char *peer_prefix = prefix;
  501. // mixer->osc_endpoint->list_peer_signals( this );
  502. Port *p = control_output[0].connected_port();
  503. const char *number_path = p->osc_number_path();
  504. const char *name_path = p->osc_path();
  505. const char *paths[] = { number_path,name_path,NULL };
  506. for ( const char **cpath = paths; *cpath; cpath++ )
  507. {
  508. const char ** conn = mixer->osc_endpoint->get_connections( *cpath );
  509. if ( conn )
  510. {
  511. for ( const char **s = conn; *s; s++ )
  512. {
  513. /* building menu */
  514. char *path = strdup( *s );
  515. unescape_url( path );
  516. char *ns;
  517. asprintf( &ns, "%s/%s", peer_prefix, path );
  518. peer_menu->add( ns, 0, NULL, const_cast<char*>(*s), 0 );
  519. free( path );
  520. // free(*s);
  521. }
  522. free( conn );
  523. }
  524. }
  525. }
  526. /** build the context menu for this control */
  527. Fl_Menu_Button &
  528. Controller_Module::menu ( void )
  529. {
  530. static Fl_Menu_Button m( 0, 0, 0, 0, "Controller" );
  531. m.clear();
  532. if ( mode() == GUI )
  533. {
  534. add_osc_peers_to_menu( &m, "Connect To" );
  535. add_osc_connections_to_menu( &m, "Disconnect From" );
  536. }
  537. m.add( "Mode/GUI + OSC", 0, 0, 0, FL_MENU_RADIO | ( mode() == GUI ? FL_MENU_VALUE : 0 ));
  538. m.add( "Mode/Control Voltage (JACK)", 0, 0, 0, FL_MENU_RADIO | ( mode() == CV ? FL_MENU_VALUE : 0 ));
  539. m.add( "Remove", 0, 0, 0, is_default() ? FL_MENU_INACTIVE : 0 );
  540. // menu_set_callback( m.items(), &Controller_Module::menu_cb, (void*)this );
  541. m.callback( &Controller_Module::menu_cb, (void*)this );
  542. // m.copy( items, (void*)this );
  543. return m;
  544. }
  545. void
  546. Controller_Module::draw ( void )
  547. {
  548. draw_box(x(),y(),w(),h());
  549. Fl_Group::draw();
  550. if ( learn_mode() )
  551. {
  552. fl_rectf( x(),y(),w(),h(), fl_color_add_alpha( FL_MAGENTA, 50 ) );
  553. }
  554. }
  555. int
  556. Controller_Module::handle ( int m )
  557. {
  558. switch ( m )
  559. {
  560. case FL_PUSH:
  561. {
  562. if ( learn_mode() )
  563. {
  564. tooltip( "Now learning control. Move the desired control on your controller" );
  565. //connect_to( &module->control_input[port] );
  566. Port *p = control_output[0].connected_port();
  567. if ( p )
  568. {
  569. const char * path = learn_by_number ? p->osc_number_path() : p->osc_path();
  570. DMESSAGE( "Will learn %s", path );
  571. mixer->osc_endpoint->learn( path );
  572. }
  573. return 1;
  574. }
  575. if ( Fl::event_button3() )
  576. {
  577. /* context menu */
  578. /* if ( type() != SPATIALIZATION ) */
  579. menu_popup( &menu() );
  580. return 1;
  581. }
  582. else
  583. return Fl_Group::handle( m );
  584. }
  585. }
  586. return Fl_Group::handle( m );
  587. }
  588. void
  589. Controller_Module::handle_control_changed ( Port *p )
  590. {
  591. /* ignore changes initiated while mouse is over widget */
  592. if ( contains( Fl::pushed() ) )
  593. return;
  594. if ( p )
  595. control_value = p->control_value();
  596. if ( control->value() == control_value )
  597. return;
  598. /* if ( control->value() != control_value ) */
  599. /* { */
  600. /* redraw(); */
  601. /* } */
  602. if ( type() == SPATIALIZATION )
  603. {
  604. Panner *pan = (Panner*)control;
  605. pan->point( 0 )->azimuth( control_output[0].control_value() );
  606. pan->point( 0 )->elevation( control_output[1].control_value() );
  607. if ( visible_r() )
  608. pan->redraw();
  609. }
  610. else
  611. {
  612. if ( type() == TOGGLE )
  613. ((Fl_Button*)control)->value(control_value);
  614. else
  615. control->value(control_value);
  616. }
  617. }
  618. void
  619. Controller_Module::command_remove ( void )
  620. {
  621. if ( is_default() )
  622. fl_alert( "Default modules may not be deleted." );
  623. else
  624. {
  625. chain()->remove( this );
  626. Fl::delete_widget( this );
  627. }
  628. }
  629. /**********/
  630. /* Engine */
  631. /**********/
  632. void
  633. Controller_Module::process ( nframes_t nframes )
  634. {
  635. THREAD_ASSERT( RT );
  636. if ( type() == SPATIALIZATION )
  637. {
  638. return;
  639. }
  640. if ( control_output[0].connected() )
  641. {
  642. float f = control_value;
  643. if ( mode() == CV )
  644. {
  645. f = *((float*)jack_input[0].buffer( nframes ));
  646. const Port *p = control_output[0].connected_port();
  647. if (p->hints.ranged )
  648. {
  649. // scale value to range.
  650. // we assume that CV values are between 0 and 1
  651. float scale = p->hints.maximum - p->hints.minimum;
  652. float offset = p->hints.minimum;
  653. f = ( f * scale ) + offset;
  654. }
  655. }
  656. // else
  657. // f = *((float*)control_output[0].buffer());
  658. *((float*)control_output[0].buffer()) = f;
  659. control_value = f;
  660. }
  661. }