Skip to content

Commit

Permalink
Add pause and stop APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Dec 18, 2023
1 parent 1de13cf commit 87be7fb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/remux/launcher.cpy
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,16 @@ class App: public IApp:
if len(tokens) > 1:
name := tokens[1]
api_launch_app(name)
else if line.find("pause ") == 0:
tokens := str_utils::split(line, ' ')
if len(tokens) > 1:
name := tokens[1]
api_pause_app(name)
else if line.find("stop ") == 0:
tokens := str_utils::split(line, ' ')
if len(tokens) > 1:
name := tokens[1]
api_stop_app(name)

else:
debug "UNKNOWN API LINE:", line
Expand Down Expand Up @@ -568,6 +578,19 @@ class App: public IApp:
debug "NO SUCH APP:", name


void api_pause_app(string name):
app := find_app(name)
get_current_app()
if app.name == CURRENT_APP:
debug "USING API TO PAUSE", name
self.show_launcher()

void api_stop_app(string name):
app := find_app(name)
if app.bin != "":
debug "USING API TO STOP", name
self.kill(name)

void show_launcher():
if ui::MainLoop::overlay_is_visible():
return
Expand Down

0 comments on commit 87be7fb

Please sign in to comment.