~ubuntu-branches/ubuntu/raring/ecasound2.2/raring

« back to all changes in this revision

Viewing changes to libecasound/eca-iamode-parser.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2009-05-06 15:18:46 UTC
  • mfrom: (5.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090506151846-dvp8mirqmxwhve66
Tags: 2.6.0-1
* New upstream release
- 08_fix_header_install: remove
- 07_configure_in_maintainer_mode: update
- do not install manpage copies, and just install symlinks for
  ecatools.1
* Build-Depend on texlive-latex-recommended too for ecrm1000 font.
  (closes: #526535)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// ------------------------------------------------------------------------
2
2
// eca-iamode-parser.cpp: Class that handles registering and querying 
3
3
//                        interactive mode commands.
4
 
// Copyright (C) 1999-2005 Kai Vehmanen
 
4
// Copyright (C) 1999-2005,2008 Kai Vehmanen
5
5
// Copyright (C) 2005 Stuart Allie
6
6
//
 
7
// Attributes:
 
8
//     eca-style-version: 3 (see Ecasound Programmer's Guide)
 
9
//
7
10
// This program is free software; you can redistribute it and/or modify
8
11
// it under the terms of the GNU General Public License as published by
9
12
// the Free Software Foundation; either version 2 of the License, or
19
22
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
20
23
// ------------------------------------------------------------------------
21
24
 
 
25
#ifdef HAVE_CONFIG_H
 
26
#include <config.h>
 
27
#endif
 
28
 
22
29
#include <map>
23
30
#include <vector>
24
31
#include <string>
64
71
      register_commands_ctrl();
65
72
      register_commands_ctrlp();
66
73
      register_commands_dump();
 
74
      register_commands_external();
67
75
    }
68
76
  }
69
 
  return(*cmd_map_repp);
 
77
  return *cmd_map_repp;
70
78
}
71
79
 
72
80
vector<string> ECA_IAMODE_PARSER::registered_commands_list(void)
78
86
    cmdlist.push_back(p->first);
79
87
    ++p;
80
88
  }
81
 
  return(cmdlist);
 
89
  return cmdlist;
82
90
}
83
91
 
84
92
void ECA_IAMODE_PARSER::register_commands_misc(void)
324
332
  (*cmd_map_repp)["dump-cop-value"] = ec_dump_cop_value;
325
333
}
326
334
 
 
335
void ECA_IAMODE_PARSER::register_commands_external(void)
 
336
{
 
337
#if ECA_COMPILE_JACK
 
338
  (*cmd_map_repp)["jack-connect"] = ec_jack_connect;
 
339
  (*cmd_map_repp)["jack-disconnect"] = ec_jack_disconnect;
 
340
  (*cmd_map_repp)["jack-list-connections"] = ec_jack_list_connections;
 
341
#endif
 
342
}
 
343
 
327
344
int ECA_IAMODE_PARSER::command_to_action_id(const std::string& cmdstring)
328
345
{
329
 
  return((*cmd_map_repp)[cmdstring]);
 
346
  return (*cmd_map_repp)[cmdstring];
330
347
}
331
348
 
332
349
bool ECA_IAMODE_PARSER::action_requires_params(int id)
386
403
  case ec_dump_target:
387
404
  case ec_dump_cop_value:
388
405
 
389
 
    return(true);
 
406
  case ec_jack_connect:
 
407
  case ec_jack_disconnect:
 
408
 
 
409
    return true;
390
410
    
391
411
  default: 
392
412
    break;
393
413
  }
394
 
  return(false);
 
414
  return false;
395
415
}
396
416
 
397
417
bool ECA_IAMODE_PARSER::action_requires_connected(int id)
405
425
  case ec_cs_disconnect:
406
426
  case ec_cs_set_position:
407
427
  case ec_cs_set_position_samples:
408
 
    return(true);
 
428
    return true;
409
429
    
410
430
  default: 
411
431
    break;
412
432
  }
413
 
  return(false);
 
433
  return false;
414
434
}
415
435
 
416
436
bool ECA_IAMODE_PARSER::action_requires_selected(int id)
502
522
  case ec_ctrl_selected:
503
523
  case ec_ctrl_status:
504
524
 
505
 
    return(true);
 
525
    return true;
506
526
 
507
527
  default: break;
508
528
  }
509
529
  
510
 
  return(false);
 
530
  return false;
511
531
}
512
532
 
513
533
bool ECA_IAMODE_PARSER::action_requires_selected_not_connected(int id)
544
564
  case ec_ao_set_position_samples:
545
565
  case ec_ao_wave_edit:
546
566
 
547
 
    return(true);
 
567
    return true;
548
568
    
549
569
  default: 
550
570
    break;
551
571
  }
552
 
  return(false);
 
572
  return false;
553
573
 
554
574
}
555
575
 
570
590
  case ec_ai_get_length_samples:
571
591
  case ec_ai_get_format:
572
592
  case ec_ai_wave_edit:
573
 
    return(true);
 
593
    return true;
574
594
    
575
595
  default: 
576
596
    break;
577
597
  }
578
 
  return(false);
 
598
  return false;
579
599
 
580
600
}
581
601
 
596
616
  case ec_ao_get_length_samples:
597
617
  case ec_ao_get_format:
598
618
  case ec_ao_wave_edit:
599
 
    return(true);
 
619
    return true;
600
620
    
601
621
  default: 
602
622
    break;
603
623
  }
604
 
  return(false);
 
624
  return false;
605
625
 
606
626
}
607
627