Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TPF
jack2
Commits
feef5ca5
Commit
feef5ca5
authored
Dec 19, 2016
by
Hoger Dehnhardt
Browse files
added a toggle command to allow toggling between play and stop state
parent
4429cbe4
Changes
1
Hide whitespace changes
Inline
Side-by-side
example-clients/transport.c
View file @
feef5ca5
...
...
@@ -211,6 +211,29 @@ static void com_timeout(char *arg)
jack_set_sync_timeout
(
client
,
(
jack_time_t
)
(
timeout
*
1000000
));
}
/* Toggle between play and stop state */
static
void
com_toggle
(
char
*
arg
)
{
jack_position_t
current
;
jack_transport_state_t
transport_state
;
transport_state
=
jack_transport_query
(
client
,
&
current
);
switch
(
transport_state
)
{
case
JackTransportStopped
:
com_play
(
arg
);
break
;
case
JackTransportRolling
:
com_stop
(
arg
);
break
;
case
JackTransportStarting
:
printf
(
"state: Starting - no transport toggling"
);
break
;
default:
printf
(
"state: Starting - no transport toggling"
);
}
}
/* Command parsing based on GNU readline info examples. */
...
...
@@ -238,6 +261,7 @@ command_t commands[] = {
{
"stop"
,
com_stop
,
"Stop transport"
},
{
"tempo"
,
com_tempo
,
"Set beat tempo <beats_per_min>"
},
{
"timeout"
,
com_timeout
,
"Set sync timeout in <seconds>"
},
{
"toggle"
,
com_toggle
,
"Toggle transport rolling"
},
{
"?"
,
com_help
,
"Synonym for `help'"
},
{(
char
*
)
NULL
,
(
cmd_function_t
*
)
NULL
,
(
char
*
)
NULL
}
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment