Showing the changes to src/core/chuck_vm.cpp (1 of 26 files). Show all
Unified · Split
| @@ -34,10 +34,18 @@ · 33 unmodified lines | ||
| 34 | 34 | #include "chuck_lang.h" |
| 35 | 35 | #include "chuck_type.h" |
| 36 | 36 | #include "chuck_dl.h" |
| 37 | −//#include "chuck_io.h" | |
| 37 | + | |
| 38 | +#ifndef __DISABLE_SERIAL__ | |
| 39 | +#include "chuck_io.h" | |
| 40 | +#endif | |
| 41 | + | |
| 38 | 42 | #include "chuck_errmsg.h" |
| 39 | 43 | #include "ugen_xxx.h" |
| 40 | −//#include "hidio_sdl.h" // 1.4.0.0 | |
| 44 | + | |
| 45 | +#ifndef __DISABLE_HID__ | |
| 46 | +#include "hidio_sdl.h" // 1.4.0.0 | |
| 47 | +#endif | |
| 48 | + | |
| 41 | 49 | #ifndef __DISABLE_MIDI__ |
| 42 | 50 | #include "midiio_rtmidi.h" // 1.4.0.1 |
| 43 | 51 | #endif |
| @@ -341,14 +349,17 @@ t_CKBOOL Chuck_VM::shutdown() · 297 unmodified lines | ||
| 341 | 349 | // free the shreduler |
| 342 | 350 | SAFE_DELETE( m_shreduler ); |
| 343 | 351 | |
| 352 | + #ifndef __DISABLE_HID__ | |
| 344 | 353 | // log |
| 345 | 354 | EM_log( CK_LOG_SYSTEM, "unregistering VM from HID manager..." ); |
| 346 | 355 | // clean up this vm |
| 347 | −// HidInManager::cleanup_buffer( this ); | |
| 356 | + HidInManager::cleanup_buffer( this ); | |
| 357 | + #endif | |
| 358 | + | |
| 359 | + #ifndef __DISABLE_MIDI__ | |
| 348 | 360 | EM_log( CK_LOG_SYSTEM, "unregistering VM from MIDI manager..." ); |
| 349 | −#ifndef __DISABLE_MIDI__ | |
| 350 | 361 | MidiInManager::cleanup_buffer( this ); |
| 351 | −#endif | |
| 362 | + #endif | |
| 352 | 363 | |
| 353 | 364 | // log |
| 354 | 365 | EM_log( CK_LOG_SYSTEM, "freeing msg/reply/event buffers..." ); |
| @@ -3559,7 +3570,9 @@ Chuck_VM_Shred::Chuck_VM_Shred() · 3204 unmodified lines | ||
| 3559 | 3570 | vm_ref = NULL; |
| 3560 | 3571 | event = NULL; |
| 3561 | 3572 | xid = 0; |
| 3562 | −// m_serials = NULL; | |
| 3573 | + #ifndef __DISABLE_SERIAL__ | |
| 3574 | + m_serials = NULL; | |
| 3575 | + #endif | |
| 3563 | 3576 | |
| 3564 | 3577 | // set |
| 3565 | 3578 | CK_TRACK( stat = NULL ); |
| @@ -3692,18 +3705,20 @@ t_CKBOOL Chuck_VM_Shred::shutdown() · 126 unmodified lines | ||
| 3692 | 3705 | // clear it |
| 3693 | 3706 | code_orig = code = NULL; |
| 3694 | 3707 | |
| 3708 | + #ifndef __DISABLE_SERIAL__ | |
| 3695 | 3709 | // HACK (added 1.3.2.0): close serial devices |
| 3696 | −// if(m_serials != NULL) | |
| 3697 | −// { | |
| 3698 | −// for(list<Chuck_IO_Serial *>::iterator i = m_serials->begin(); i != m_serials->end(); i++) | |
| 3699 | −// { | |
| 3700 | −// (*i)->release(); | |
| 3701 | −// (*i)->close(); | |
| 3702 | −// } | |
| 3703 | −// | |
| 3704 | −// m_serials->clear(); | |
| 3705 | −// SAFE_DELETE(m_serials); | |
| 3706 | −// } | |
| 3710 | + if(m_serials != NULL) | |
| 3711 | + { | |
| 3712 | + for(list<Chuck_IO_Serial *>::iterator i = m_serials->begin(); i != m_serials->end(); i++) | |
| 3713 | + { | |
| 3714 | + (*i)->release(); | |
| 3715 | + (*i)->close(); | |
| 3716 | + } | |
| 3717 | + | |
| 3718 | + m_serials->clear(); | |
| 3719 | + SAFE_DELETE(m_serials); | |
| 3720 | + } | |
| 3721 | + #endif | |
| 3707 | 3722 | |
| 3708 | 3723 | // 1.3.5.3 pop all loop counters |
| 3709 | 3724 | while( this->popLoopCounter() ); |
| @@ -3835,31 +3850,33 @@ CK_VM_DEBUG(CK_FPRINTF_STDERR( "CK_VM_DEBUG reg sp in: 0x%08lx out: 0x%08lx\n", · 125 unmodified lines | ||
| 3835 | 3850 | |
| 3836 | 3851 | |
| 3837 | 3852 | |
| 3838 | −////----------------------------------------------------------------------------- | |
| 3839 | −//// name: add_serialio() | |
| 3840 | −//// desc: ... | |
| 3841 | −////----------------------------------------------------------------------------- | |
| 3842 | −//t_CKVOID Chuck_VM_Shred::add_serialio( Chuck_IO_Serial * serial ) | |
| 3843 | −//{ | |
| 3844 | −// if(m_serials == NULL) | |
| 3845 | −// m_serials = new list<Chuck_IO_Serial *>; | |
| 3846 | −// serial->add_ref(); | |
| 3847 | −// m_serials->push_back( serial ); | |
| 3848 | −//} | |
| 3849 | −// | |
| 3850 | −// | |
| 3851 | −// | |
| 3852 | −////----------------------------------------------------------------------------- | |
| 3853 | −//// name: add_serialio() | |
| 3854 | −//// desc: ... | |
| 3855 | −////----------------------------------------------------------------------------- | |
| 3856 | −//t_CKVOID Chuck_VM_Shred::remove_serialio( Chuck_IO_Serial * serial ) | |
| 3857 | −//{ | |
| 3858 | −// if(m_serials == NULL) | |
| 3859 | −// return; | |
| 3860 | −// m_serials->remove( serial ); | |
| 3861 | −// serial->release(); | |
| 3862 | −//} | |
| 3853 | +#ifndef __DISABLE_SERIAL__ | |
| 3854 | +//----------------------------------------------------------------------------- | |
| 3855 | +// name: add_serialio() | |
| 3856 | +// desc: ... | |
| 3857 | +//----------------------------------------------------------------------------- | |
| 3858 | +t_CKVOID Chuck_VM_Shred::add_serialio( Chuck_IO_Serial * serial ) | |
| 3859 | +{ | |
| 3860 | + if(m_serials == NULL) | |
| 3861 | + m_serials = new list<Chuck_IO_Serial *>; | |
| 3862 | + serial->add_ref(); | |
| 3863 | + m_serials->push_back( serial ); | |
| 3864 | +} | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | +//----------------------------------------------------------------------------- | |
| 3869 | +// name: add_serialio() | |
| 3870 | +// desc: ... | |
| 3871 | +//----------------------------------------------------------------------------- | |
| 3872 | +t_CKVOID Chuck_VM_Shred::remove_serialio( Chuck_IO_Serial * serial ) | |
| 3873 | +{ | |
| 3874 | + if(m_serials == NULL) | |
| 3875 | + return; | |
| 3876 | + m_serials->remove( serial ); | |
| 3877 | + serial->release(); | |
| 3878 | +} | |
| 3879 | +#endif | |
| 3863 | 3880 | |
| 3864 | 3881 | |
| 3865 | 3882 | |