Skip to content

Commit

Permalink
#1725 WIP fixes file uri on windows and add recording dialog DI issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
sheirerd committed Dec 29, 2023
1 parent 454771a commit c15e1c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

import io.github.dsheirer.audio.call.Call;
import io.github.dsheirer.source.mixer.MixerChannel;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javafx.application.Platform;
Expand Down Expand Up @@ -223,7 +225,7 @@ private void loadMediaPlayer()
if(mCall.getFile() != null)
{
//Create a new media player
mMediaPlayer.set(new MediaPlayer(new Media("file://" + mCall.getFile())));
mMediaPlayer.set(new MediaPlayer(new Media(new File(mCall.getFile()).toURI().toString())));
//Register status listener
mMediaPlayer.get().statusProperty().addListener(this);
//Register runnable for end-of-media event
Expand All @@ -234,7 +236,6 @@ private void loadMediaPlayer()
mMediaPlayer.get().setAutoPlay(true);
}
}

/**
* Stops playback and clears the media player.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ private void process()
{
it.remove();
excessCalls--;
System.out.println("Removed excess call TO:" + call.getToId() + " FM:" + call.getFromId());
}
}
}
Expand Down Expand Up @@ -197,6 +198,7 @@ private void process()
{
Call call = leftCalls.get(0);
mCalls.remove(call);
System.out.println("Playing call to: " + call.getToId() + " fm:" + call.getFromId());
left.play(call);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class AddRecordingTunerDialog extends JFrame
private final static Logger mLog = LoggerFactory.getLogger(AddRecordingTunerDialog.class);
private static final String SELECT_A_FILE = "Please select a recording file";
private static final String LAST_FILE_BROWSE_LOCATION_KEY = "AddRecordingTunerDialog.lastBrowseLocation";
@Resource
private UserPreferences mUserPreferences;
private DiscoveredTunerModel mDiscoveredTunerModel;
private TunerConfigurationManager mTunerConfigurationManager;
Expand All @@ -72,17 +71,15 @@ public class AddRecordingTunerDialog extends JFrame
* @param discoveredTunerModel for tuners
* @param tunerConfigurationManager for configurations
*/
public AddRecordingTunerDialog(DiscoveredTunerModel discoveredTunerModel, TunerConfigurationManager tunerConfigurationManager)
public AddRecordingTunerDialog(DiscoveredTunerModel discoveredTunerModel,
TunerConfigurationManager tunerConfigurationManager, UserPreferences userPreferences)
{
Validate.notNull(discoveredTunerModel, "TunerModel cannot be null");
Validate.notNull(tunerConfigurationManager, "TunerConfigurationManager cannot be null");
mDiscoveredTunerModel = discoveredTunerModel;
mTunerConfigurationManager = tunerConfigurationManager;
}
mUserPreferences = userPreferences;

@PostConstruct
public void postConstruct()
{
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setTitle("Select Recording File");
setSize(new Dimension(500, 250));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package io.github.dsheirer.source.tuner.ui;

import com.jidesoft.swing.JideSplitPane;
import io.github.dsheirer.preference.UserPreferences;
import io.github.dsheirer.preference.swing.JTableColumnWidthMonitor;
import io.github.dsheirer.source.tuner.configuration.TunerConfigurationManager;
import io.github.dsheirer.source.tuner.manager.DiscoveredRecordingTuner;
Expand Down Expand Up @@ -66,6 +67,8 @@ public class TunerViewPanel extends JPanel
private TunerConfigurationManager mTunerConfigurationManager;
@Resource
private DiscoveredTunerEditor mDiscoveredTunerEditor;
@Resource
private UserPreferences mUserPreferences;
private JTable mTunerTable;
private JTableColumnWidthMonitor mColumnWidthMonitor;
private TableRowSorter<DiscoveredTunerModel> mRowSorter;
Expand Down Expand Up @@ -210,7 +213,8 @@ private JButton getAddRecordingButton()
mAddRecordingButton = new JButton("Add Recording Tuner");
mAddRecordingButton.addActionListener(e ->
{
AddRecordingTunerDialog dialog = new AddRecordingTunerDialog(mDiscoveredTunerModel, mTunerConfigurationManager);
AddRecordingTunerDialog dialog = new AddRecordingTunerDialog(mDiscoveredTunerModel,
mTunerConfigurationManager, mUserPreferences);
dialog.setLocationRelativeTo(TunerViewPanel.this);
EventQueue.invokeLater(() -> dialog.setVisible(true));
});
Expand Down

0 comments on commit c15e1c1

Please sign in to comment.