Escape to shell in interactive mode

Hans Bezemer via Ecasound-list <[email protected]> Sat, 22 Mar 2025 11:27:12 +0100
Newsgroups gmane.comp.audio.ecasound.general
Message-ID <4ovhrul5m2vory6oj7p5hoiwntrgivnius6hjhhxn4u2jqyo7r@o26lewbmbfa7>
--ni7binq5243aqx73
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

Dear fellow ecasound users,

Lately I'm using ecasound in interactive mode more frequently.
To speed up me workflow (I make most of my changes by editing
the chain setup in vi) I added some shorthands for editing,
saving and getting and setting the position.
I've attached a patch file for those interested.

Although the workflow is pretty comfortable, I sometimes
want to be able to send shell commands.
Somewhere along the lines of:
!cp Temp.wav Guitar.wav
!ls
!make c #to make a commit with a timestamp
Of course this can be done when editing using vi or
by pressing ctrl-z,
but sometimes it would be nice to do this directly 
from ecasound.

Although not a programmer I would like to give it
a try to implement this, but I would like to get
some pointers before I dive in.
Would this be a useful feature?
Are the things to consider before starting?

Kind regards,

Hans



--ni7binq5243aqx73
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename="shorthand.patch"

diff --git a/Documentation/ecasound-iam_manpage.yo b/Documentation/ecasound-iam_manpage.yo
index fc971c28..88a6dc68 100644
--- a/Documentation/ecasound-iam_manpage.yo
+++ b/Documentation/ecasound-iam_manpage.yo
@@ -184,7 +184,7 @@ dit(cs-load 'filename')
 Adds a new chainsetup by loading it from file 'filename'. 
 'filename' is now the selected chainsetup. em([-])
 
-dit(cs-save) 
+dit(cs-save, save) 
 Saves the currently selected chainsetup to file. If chainsetup was loaded
 from a file, the saved version will replace the original. If it doesn't 
 have a default filename, it's saved to "chainsetup_name.ecs". em([-])
@@ -192,7 +192,7 @@ have a default filename, it's saved to "chainsetup_name.ecs". em([-])
 dit(cs-save-as 'filename')
 Saves currently selected chainsetup to file 'filename'. em([-])
 
-dit(cs-edit) 
+dit(cs-edit, edit, ed, e) 
 Currently selected chainsetup is saved to a temporary file. This
 file is loaded to an external editor (see ecasoundrc (5)). After
 editing, the chainsetup is loaded back to ecasound. em([-])
@@ -224,7 +224,7 @@ The current chainsetup position is forwarded by 'time-in-seconds'
 seconds. Position of all inputs and outputs attached to the selected chainsetup
 is also affected. em([-])
  
-dit(cs-set-position 'time-in-seconds', cs-setpos 'time-in-seconds', setpos 'time-in-seconds', set-position 'time-in-seconds')
+dit(cs-set-position 'time-in-seconds', cs-setpos 'time-in-seconds', setpos 'time-in-seconds', set-position 'time-in-seconds', sp 'time-in-seconds')
 Sets the chainsetup position to 'time-in-seconds' seconds from the 
 beginning. Position of all inputs and outputs attached to the selected 
 chainsetup is also affected. em([-])
@@ -234,7 +234,7 @@ Sets the chainsetup position to 'time-in-samples' samples from the
 beginning. Position of all inputs and outputs attached to the selected 
 chainsetup is also affected. em([-])
 
-dit(cs-get-position, cs-getpos, getpos, get-position)
+dit(cs-get-position, cs-getpos, getpos, get-position, gp)
 Returns the current chainsetup position in seconds. em([f])
 
 dit(cs-get-position-samples)
diff --git a/libecasound/eca-iamode-parser.cpp b/libecasound/eca-iamode-parser.cpp
index 9754ddf1..8dc0e206 100644
--- a/libecasound/eca-iamode-parser.cpp
+++ b/libecasound/eca-iamode-parser.cpp
@@ -152,8 +152,12 @@ void ECA_IAMODE_PARSER::register_commands_cs(void)
   (*cmd_map_repp)["cs-iselect"] = ec_cs_index_select;
   (*cmd_map_repp)["cs-load"] = ec_cs_load;
   (*cmd_map_repp)["cs-save"] = ec_cs_save;
+  (*cmd_map_repp)["save"] = ec_cs_save;
   (*cmd_map_repp)["cs-save-as"] = ec_cs_save_as;
   (*cmd_map_repp)["cs-edit"] = ec_cs_edit;
+  (*cmd_map_repp)["edit"] = ec_cs_edit;
+  (*cmd_map_repp)["ed"] = ec_cs_edit;
+  (*cmd_map_repp)["e"] = ec_cs_edit;
   (*cmd_map_repp)["cs-is-valid"] = ec_cs_is_valid;
   (*cmd_map_repp)["cs-connect"] = ec_cs_connect;
   (*cmd_map_repp)["cs-connected"] = ec_cs_connected;
@@ -171,11 +175,13 @@ void ECA_IAMODE_PARSER::register_commands_cs(void)
   (*cmd_map_repp)["cs-set-position"] = ec_cs_set_position;
   (*cmd_map_repp)["cs-set-position-samples"] = ec_cs_set_position_samples;
   (*cmd_map_repp)["setpos"] = ec_cs_set_position;
+  (*cmd_map_repp)["sp"] = ec_cs_set_position;
   (*cmd_map_repp)["set-position"] = ec_cs_set_position;
   (*cmd_map_repp)["cs-getpos"] = ec_cs_get_position;
   (*cmd_map_repp)["cs-get-position"] = ec_cs_get_position;
   (*cmd_map_repp)["cs-get-position-samples"] = ec_cs_get_position_samples;
   (*cmd_map_repp)["getpos"] = ec_cs_get_position;
+  (*cmd_map_repp)["gp"] = ec_cs_get_position;
   (*cmd_map_repp)["get-position"] = ec_cs_get_position;
   (*cmd_map_repp)["cs-get-length"] = ec_cs_get_length;
   (*cmd_map_repp)["cs-get-length-samples"] = ec_cs_get_length_samples;

--ni7binq5243aqx73
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--ni7binq5243aqx73
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ecasound-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ecasound-list

--ni7binq5243aqx73--