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