Skip to content

Commit a06abb4

Browse files
committed
Hide timelapse options according to platform
1 parent 80ea76e commit a06abb4

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

data/skins/default/gui/MainWindow.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
<menubutton id="recbutton"
1919
click="toggleui id=recmenu"
2020
label="Timelapse"
21-
width="100px"/>
21+
width="100px"
22+
controller="recorderhider"/>
2223
<node width="100%" id="mainbarspacer"/>
2324
<node id="toolconfigquick" controller="metamenu" filter="quick" flow="contain-row"/>
2425
<image controller="tabtarget, button"

src/cmd/Recording.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ class Encoder {
5252
TaskHandle handle;
5353

5454
bool done() {
55-
return handle.task->isDone();
55+
return handle.task && handle.task->isDone();
5656
}
5757

5858
void run() {
59+
#if !defined(__N3DS__) && !defined(__ANDROID__)
5960
String cmd;
6061
PubSub<>::pub(msg::RecorderEncodingStart{});
6162

@@ -84,6 +85,7 @@ class Encoder {
8485
PubSub<>::pub(msg::RecorderEncodingFail{});
8586
}
8687
});
88+
#endif
8789
}
8890
};
8991
static std::optional<Encoder> encoder;
@@ -146,6 +148,16 @@ class RecorderStatus : public ui::Controller {
146148
};
147149
static ui::Controller::Shared<RecorderStatus> recstat{"recorderstatus"};
148150

151+
class RecorderHider : public ui::Controller {
152+
public:
153+
void attach() override {
154+
#if defined(EMSCRIPTEN)
155+
node()->set("visible", false);
156+
#endif
157+
}
158+
};
159+
static ui::Controller::Shared<RecorderHider> rechider{"recorderhider"};
160+
149161
class RecorderSequence : public ui::Controller {
150162
public:
151163
PubSub<msg::RecorderUpdateSequence> pub{this};
@@ -174,6 +186,9 @@ class RecorderEncode : public ui::Controller {
174186
Property<String> label{this, "label", "${value}"};
175187

176188
void attach() override {
189+
#if defined(__N3DS__) || defined(__ANDROID__)
190+
node()->set("visible", false);
191+
#else
177192
if (encoder) {
178193
if (encoder->done())
179194
on(msg::RecorderEncodingDone{});
@@ -182,6 +197,7 @@ class RecorderEncode : public ui::Controller {
182197
} else {
183198
on(msg::RecorderUpdateSequence{});
184199
}
200+
#endif
185201
}
186202

187203
void on(const msg::RecorderUpdateSequence&) {

0 commit comments

Comments
 (0)