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

« back to all changes in this revision

Viewing changes to libecasound/eca-control.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2008-09-26 09:58:52 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080926095852-k3v9ewhmxpaltusw
Tags: 2.5.2-3
yodl 2.13.1 removed --unique-output option. Remove --unique-output
accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// ------------------------------------------------------------------------
2
2
// eca-control.cpp: Class for controlling the whole ecasound library
3
 
// Copyright (C) 1999-2005 Kai Vehmanen
 
3
// Copyright (C) 1999-2005,2008 Kai Vehmanen
4
4
// Copyright (C) 2005 Stuart Allie
5
5
//
6
6
// Attributes:
7
 
//     eca-style-version: 3
 
7
//     eca-style-version: 3 (see Ecasound Programmer's Guide)
8
8
//
9
9
// This program is free software; you can redistribute it and/or modify
10
10
// it under the terms of the GNU General Public License as published by
111
111
      // ---
112
112
      if (p->size() > 0 && (*p)[0] == '-') {
113
113
        //  std::cerr << "Note! Direct use of EOS-options (-prefix:arg1,...,argN)" << " as iactive-mode commands is considered deprecated. " << "\tUse the notation 'cs-option -prefix:a,b,x' instead." << std::endl;
114
 
        chainsetup_option(cmd);
 
114
        if (*p == "-i")
 
115
          ECA_LOG_MSG(ECA_LOGGER::info, 
 
116
                      "WARNING: syntax variant '-i file.ext' not supported, please use 'ai-add file.ext' instead.");
 
117
        else if (*p == "-o")
 
118
          ECA_LOG_MSG(ECA_LOGGER::info, 
 
119
                      "WARNING: syntax variant '-o file.ext' not supported, please use 'ai-add file.ext' instead.");
 
120
        else
 
121
          chainsetup_option(cmd);
115
122
      }
116
123
      else {
117
124
        set_last_error("Unknown command!");
770
777
string ECA_CONTROL::chainsetup_details_to_string(const ECA_CHAINSETUP* cs) const
771
778
{
772
779
  string result;
 
780
  vector<CHAIN*>::const_iterator chain_citer;
773
781
 
774
782
  result += "\n -> Objects: " + kvu_numtostr(cs->inputs.size());
775
783
  result += " inputs, " + kvu_numtostr(cs->outputs.size());
779
787
  // FIXME: add explanations on why the chainsetup cannot be
780
788
  //        connected
781
789
 
782
 
  if (cs->is_valid()) 
 
790
  if (cs->is_locked()) {
 
791
    result += "\n -> State:   connected to engine (engine status: ";
 
792
    result += engine_status() + ")";
 
793
  }
 
794
  else if (cs->is_enabled() && is_engine_started() == true) {
 
795
    result += "\n -> State:   connected (engine status: ";
 
796
    result += engine_status() + ")";
 
797
  }
 
798
  else if (cs->is_enabled())
 
799
    result += "\n -> State:   connected (engine not yet running)";
 
800
  else if (cs->is_valid()) 
783
801
    result += "\n -> State:   valid (can be connected)";
784
802
  else
785
803
    result += "\n -> State:   not valid (cannot be connected)";
 
804
  
 
805
  result += "\n -> Position:  ";
 
806
  result += kvu_numtostr(cs->position_in_seconds_exact(), 3);
 
807
  result += " / ";
 
808
  if (cs->length_set())
 
809
    result += kvu_numtostr(cs->length_in_seconds_exact(), 3);
 
810
  else
 
811
    result += "inf";
786
812
 
787
813
  result += "\n -> Options: ";
788
814
  result += cs->options_to_string();
 
815
 
 
816
  for(chain_citer = cs->chains.begin();
 
817
      chain_citer != cs->chains.end();) {
 
818
    result += "\n -> Chain \"" + (*chain_citer)->name() + "\": ";
 
819
    int idx =
 
820
      (*chain_citer)->connected_input();
 
821
    if (idx >= 0)
 
822
      result += ECA_OBJECT_FACTORY::audio_object_to_eos(cs->inputs[idx], "i");
 
823
    result += " ";
 
824
    result += (*chain_citer)->to_string();
 
825
    result += " ";
 
826
    idx = (*chain_citer)->connected_output();
 
827
    if (idx >= 0)
 
828
      result += ECA_OBJECT_FACTORY::audio_object_to_eos(cs->outputs[idx], "o");
 
829
 
 
830
    ++chain_citer;
 
831
  }
789
832
  
790
833
  return result;
791
834
}
799
842
  while(cs_citer != session_repp->chainsetups_rep.end()) {
800
843
    result += "Chainsetup ("  + kvu_numtostr(++index) + ") \"";
801
844
    result += (*cs_citer)->name() + "\" ";
802
 
    if ((*cs_citer)->name() == selected_chainsetup()) result += "[selected] ";
803
 
    if ((*cs_citer)->name() == connected_chainsetup()) result += "[connected] ";
804
 
    result += chainsetup_details_to_string((*cs_citer));
805
 
    
 
845
 
 
846
    if (*cs_citer ==
 
847
        selected_chainsetup_repp)
 
848
      result += "[selected] ";
 
849
    if (*cs_citer ==
 
850
        session_repp->connected_chainsetup_repp)
 
851
      result += "[connected] ";
 
852
 
 
853
    if ((*cs_citer == selected_chainsetup_repp) ||
 
854
        (*cs_citer == session_repp->connected_chainsetup_repp))
 
855
      result += chainsetup_details_to_string((*cs_citer));
 
856
    else
 
857
      result += ": <detailed status omitted -- set as selected to see full status>";
 
858
 
806
859
    ++cs_citer;
807
860
    if (cs_citer != session_repp->chainsetups_rep.end()) result += "\n";
808
861
  }