forked from j62/ctbrec
1
0
Fork 0

Rename Recorder.isRecording to Recorder.isTracked

This commit is contained in:
0xboobface 2019-02-05 14:45:44 +01:00
parent 198a9c6893
commit 76f4583ebc
5 changed files with 9 additions and 9 deletions

View File

@ -97,7 +97,7 @@ public class ThumbCell extends StackPane {
this.thumbCellList = parent.grid.getChildren(); this.thumbCellList = parent.grid.getChildren();
this.model = model; this.model = model;
this.recorder = recorder; this.recorder = recorder;
recording = recorder.isRecording(model); recording = recorder.isTracked(model);
model.setSuspended(recorder.isSuspended(model)); model.setSuspended(recorder.isSuspended(model));
this.setStyle("-fx-background-color: -fx-base"); this.setStyle("-fx-background-color: -fx-base");
@ -576,7 +576,7 @@ public class ThumbCell extends StackPane {
private void update() { private void update() {
model.setSuspended(recorder.isSuspended(model)); model.setSuspended(recorder.isSuspended(model));
setRecording(recorder.isRecording(model)); setRecording(recorder.isTracked(model));
setImage(model.getPreview()); setImage(model.getPreview());
String txt = recording ? " " : ""; String txt = recording ? " " : "";
txt += model.getDescription() != null ? model.getDescription() : ""; txt += model.getDescription() != null ? model.getDescription() : "";

View File

@ -444,7 +444,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
start.setOnAction((e) -> startStopAction(getSelectedThumbCells(cell), true)); start.setOnAction((e) -> startStopAction(getSelectedThumbCells(cell), true));
MenuItem stop = new MenuItem("Stop Recording"); MenuItem stop = new MenuItem("Stop Recording");
stop.setOnAction((e) -> startStopAction(getSelectedThumbCells(cell), false)); stop.setOnAction((e) -> startStopAction(getSelectedThumbCells(cell), false));
MenuItem startStop = recorder.isRecording(cell.getModel()) ? stop : start; MenuItem startStop = recorder.isTracked(cell.getModel()) ? stop : start;
MenuItem pause = new MenuItem("Pause Recording"); MenuItem pause = new MenuItem("Pause Recording");
pause.setOnAction((e) -> pauseResumeAction(getSelectedThumbCells(cell), true)); pause.setOnAction((e) -> pauseResumeAction(getSelectedThumbCells(cell), true));
@ -510,7 +510,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
contextMenu.setHideOnEscape(true); contextMenu.setHideOnEscape(true);
contextMenu.setAutoFix(true); contextMenu.setAutoFix(true);
contextMenu.getItems().addAll(openInPlayer, startStop); contextMenu.getItems().addAll(openInPlayer, startStop);
if(recorder.isRecording(cell.getModel())) { if(recorder.isTracked(cell.getModel())) {
contextMenu.getItems().add(pauseResume); contextMenu.getItems().add(pauseResume);
} }
if(site.supportsFollow()) { if(site.supportsFollow()) {
@ -738,7 +738,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
ObservableList<Node> thumbs = grid.getChildren(); ObservableList<Node> thumbs = grid.getChildren();
for (int i = thumbs.size()-1; i > 0; i--) { for (int i = thumbs.size()-1; i > 0; i--) {
ThumbCell thumb = (ThumbCell) thumbs.get(i); ThumbCell thumb = (ThumbCell) thumbs.get(i);
if(recorder.isRecording(thumb.getModel())) { if(recorder.isTracked(thumb.getModel())) {
thumbs.remove(i); thumbs.remove(i);
thumbsToMove.add(0, thumb); thumbsToMove.add(0, thumb);
} }

View File

@ -263,7 +263,7 @@ public class LocalRecorder implements Recorder {
} }
@Override @Override
public boolean isRecording(Model model) { public boolean isTracked(Model model) {
lock.lock(); lock.lock();
try { try {
return models.contains(model); return models.contains(model);
@ -345,7 +345,7 @@ public class LocalRecorder implements Recorder {
} }
try { try {
boolean modelInRecordingList = isRecording(model); boolean modelInRecordingList = isTracked(model);
boolean online = model.isOnline(IGNORE_CACHE); boolean online = model.isOnline(IGNORE_CACHE);
if (modelInRecordingList && online) { if (modelInRecordingList && online) {
LOG.info("Restarting recording for model {}", model); LOG.info("Restarting recording for model {}", model);

View File

@ -20,7 +20,7 @@ public interface Recorder {
* Returns true, if a model is in the list of models to record. This does not reflect, if there currently is a recording running. The model might be offline * Returns true, if a model is in the list of models to record. This does not reflect, if there currently is a recording running. The model might be offline
* aswell. * aswell.
*/ */
public boolean isRecording(Model model); public boolean isTracked(Model model);
/** /**
* Get the list of all models, which are tracked by ctbrec * Get the list of all models, which are tracked by ctbrec

View File

@ -122,7 +122,7 @@ public class RemoteRecorder implements Recorder {
} }
@Override @Override
public boolean isRecording(Model model) { public boolean isTracked(Model model) {
return models != null && models.contains(model); return models != null && models.contains(model);
} }