Changeset 5836:81ccac5ddc61 in roaraudio for libroar


Ignore:
Timestamp:
01/06/13 20:38:43 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Added half of the support for AppSched? Triggers ABOUT, HELP and PREFERENCES. This includes support in roarpluginrunner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/roardl.c

    r5835 r5836  
    820820} 
    821821 
     822int                      roar_dl_appsched_trigger__handle_about(struct roar_dl_lhandle * lhandle) { 
     823 libroar_dl_service_apitype(roar_service_about) api; 
     824 int ret, err; 
     825 
     826 if ( roar_dl_service_get_api(NULL, ROAR_SERVICE_ABOUT_NAME, ROAR_SERVICE_ABOUT_ABI, &api) == -1 ) 
     827  return -1; 
     828 
     829 ret = libroar_dl_service_run_func(api, show, int, roar_dl_getlibname(lhandle)); 
     830 err = roar_error; 
     831 
     832 libroar_dl_service_free_api(api); 
     833 
     834 roar_error = err; 
     835 return ret; 
     836} 
     837 
     838int                      roar_dl_appsched_trigger__handle_help(struct roar_dl_lhandle * lhandle) { 
     839 libroar_dl_service_apitype(roar_service_help) api; 
     840 int ret, err; 
     841 
     842 if ( roar_dl_service_get_api(NULL, ROAR_SERVICE_HELP_NAME, ROAR_SERVICE_HELP_ABI, &api) == -1 ) 
     843  return -1; 
     844 
     845 ret = libroar_dl_service_run_func(api, show, int, roar_dl_getlibname(lhandle), NULL); 
     846 err = roar_error; 
     847 
     848 libroar_dl_service_free_api(api); 
     849 
     850 roar_error = err; 
     851 return ret; 
     852} 
     853 
     854int                      roar_dl_appsched_trigger__handle_preferences(struct roar_dl_lhandle * lhandle) { 
     855 roar_err_set(ROAR_ERROR_NOSYS); 
     856 return -1; 
     857} 
     858 
    822859int                      roar_dl_appsched_trigger(struct roar_dl_lhandle * lhandle, enum roar_dl_appsched_trigger trigger) { 
    823860 int (*func)  (struct roar_dl_librarypara * para) = NULL; 
     
    849886  _trig(tick, TICK); 
    850887  _trig(wait, WAIT); 
     888 
     889  // not yet supported by struct roar_dl_appsched. 
     890  case ROAR_DL_APPSCHED_ABOUT: 
     891  case ROAR_DL_APPSCHED_HELP: 
     892  case ROAR_DL_APPSCHED_PREFERENCES: 
     893    func = NULL; 
     894   break; 
    851895// use ifndef here so warnings of unhandled enum values will be shown in DEBUG mode. 
    852896#ifndef DEBUG 
     
    866910   lhandle->runtime_flags -= RTF_APPSCHED_INITED; 
    867911  } 
    868   roar_err_set(ROAR_ERROR_NOENT); 
    869   return -1; 
     912  switch (trigger) { 
     913   case ROAR_DL_APPSCHED_ABOUT: 
     914     return roar_dl_appsched_trigger__handle_about(lhandle); 
     915    break; 
     916   case ROAR_DL_APPSCHED_HELP: 
     917     return roar_dl_appsched_trigger__handle_help(lhandle); 
     918    break; 
     919   case ROAR_DL_APPSCHED_PREFERENCES: 
     920     return roar_dl_appsched_trigger__handle_preferences(lhandle); 
     921    break; 
     922   default: 
     923     roar_err_set(ROAR_ERROR_NOENT); 
     924     return -1; 
     925    break; 
     926  } 
    870927 } 
    871928 
Note: See TracChangeset for help on using the changeset viewer.