Commit eaf1fcae authored by ludwig's avatar ludwig

-> minor changes:

prepared a new interface
added new webcam icon in record mode

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@80 0463f305-d864-43cb-8a47-61cf597d4139
parent 21fe3eca
......@@ -177,11 +177,11 @@ public class Recorder implements MessageConsumer, Closeable {
// create control panel
JPanel controlPanel;
final String RECORD = "record";
final String STOP = "stop";
final String RECORD = "start recording";
final String STOP = "stop recording";
final String PLAY = "play";
final JButton recordButton = new RollOverButton(Constants.getIcon("Record24.gif"), RECORD);
final JButton recordButton = new RollOverButton(Constants.getIcon("Record24.png"), RECORD);
final JButton stopButton = new RollOverButton(Constants.getIcon("Stop24.gif"), STOP);
final JButton playButton = new RollOverButton(Constants.getIcon("Play24.gif"), PLAY);
......@@ -243,8 +243,10 @@ public class Recorder implements MessageConsumer, Closeable {
//Creates a show/hide button for the videocamera
public Component getVideoControls() {
final JButton hideButton = new RollOverButton("Show Cam");
final String WEBCAM = "Hide Webcam";
final JButton hideButton = new RollOverButton(Constants.getIcon("Webcam24.png"), WEBCAM);
hideButton.setEnabled(true);
hideButton.setEnabled(true);
JPanel controlPanel = (JPanel) getControls_3Buttons();
......@@ -255,10 +257,10 @@ public class Recorder implements MessageConsumer, Closeable {
if(VideoRecorder != null){
if(VideoRecorder.isVisible()){
VideoRecorder.setVisible(false);
hideButton.setText("Show Cam");
hideButton.setToolTipText("Show Webcam");
} else {
VideoRecorder.setVisible(true);
hideButton.setText("Hide Cam");
hideButton.setToolTipText(WEBCAM);
}
......@@ -367,7 +369,7 @@ public class Recorder implements MessageConsumer, Closeable {
//VideoRec start
if(lectureProfile.isRecordVideoEnabled()){
VideoRecorder.setRecordpath(file.getCanonicalPath().substring(0, file.getCanonicalPath().length()-4));
VideoRecorder.Start();
VideoRecorder.start();
}
......@@ -452,7 +454,7 @@ public class Recorder implements MessageConsumer, Closeable {
VideoRecorder.close();
VideoRecorder = null;
} else{
VideoRecorder.Stop();
VideoRecorder.stop();
}
}
......
......@@ -61,6 +61,7 @@ import ttt.TTT;
import ttt.messages.Annotation;
import ttt.messages.CursorMessage;
import ttt.messages.CursorPositionMessage;
import ttt.messages.GraphicInterface;
import ttt.messages.Message;
import ttt.messages.MessageConsumer;
import ttt.messages.MessageProducer;
......@@ -68,7 +69,7 @@ import ttt.messages.WhiteboardMessage;
import ttt.postprocessing.podcast.PodcastCreator;
import ttt.record.Recording;
public class GraphicsContext extends JComponent implements MessageConsumer {
public class GraphicsContext extends JComponent implements GraphicInterface, MessageConsumer {
public ProtocolPreferences prefs;
private MessageProducer producer;
......
package ttt.messages;
public interface GraphicInterface {
}
......@@ -412,8 +412,6 @@ public class Player extends JInternalFrame {
// finish init
initInternalFrame(graphicsContext);
// start playback
recording.play();
......
......@@ -575,7 +575,7 @@ public class LectureProfileDialog {
recorderCheckBox.setSelected(profile.isRecordEnabled());
// recordVideoCheckBox.setSelected(profile.isRecordVideoEnabled());
// recordVideoCheckBox.setVisible(recorderCheckBox.isSelected());
if (CameraSettings!=null) if(CameraSettings.CamerasFound()){
if (CameraSettings!=null) if(CameraSettings.camerasFound()){
videoRecordingOnCheckbox.setSelected(profile.isRecordVideoEnabled());
videoRecordingOffCheckbox.setSelected(!profile.isRecordVideoEnabled());
if( CameraSettings.getCameraIDs().contains(profile.getRecordingCamera()))
......@@ -674,7 +674,7 @@ public class LectureProfileDialog {
components[i].setEnabled(true);
}
if(CameraSettings.CamerasFound()){
if(CameraSettings.camerasFound()){
components = videoRecordingPanel.getComponents();
for (int i = 0; i < components.length; i++) {
components[i].setEnabled(true);
......
......@@ -95,7 +95,7 @@ public class LinuxCam implements WebCamControl, Runnable {
}
@Override
public boolean Start() {
public boolean start() {
boolean check = false;
if (CamFound)
try {
......@@ -124,7 +124,7 @@ public class LinuxCam implements WebCamControl, Runnable {
}
@Override
public boolean Stop() {
public boolean stop() {
if (isRecording) {
captureThread = null;
isRecording = false;
......@@ -216,7 +216,7 @@ public class LinuxCam implements WebCamControl, Runnable {
}
@Override
public boolean CameraFound() {
public boolean cameraFound() {
return CamFound;
}
......
......@@ -65,7 +65,7 @@ public class VideoRecorderPanel implements WindowListener{
//MyCapture is a nested class within VideoRecroderPanel
WBC.setCaptureInterface(new MyCapture());
if (WBC.CameraFound()) {
if (WBC.cameraFound()) {
setRecordingCamera(RecordingCamera);
setRecordingFormat(Format);
setRecordpath(RecordPath);
......@@ -99,13 +99,13 @@ public class VideoRecorderPanel implements WindowListener{
/**
* Starts recording
*/
public void Start() {
if (WBC.CameraFound())
public void start() {
if (WBC.cameraFound())
if (!isRecording) {
WBC.setFormat(tttFormat.getWidth(), tttFormat.getHeight());
setSize();
try {
WBC.Start();
WBC.start();
} catch (CameraStartException e) {
e.printStackTrace();
}
......@@ -117,10 +117,10 @@ public class VideoRecorderPanel implements WindowListener{
/**
* Stops recording
*/
public void Stop() {
public void stop() {
if (isRecording) {
try {
WBC.Stop();
WBC.stop();
} catch (CameraStopException e) {
e.printStackTrace();
}
......@@ -146,7 +146,7 @@ public class VideoRecorderPanel implements WindowListener{
}
public void close() {
Stop();
stop();
frame.dispose();
}
......
......@@ -79,7 +79,7 @@ public class VideoSettingPanel implements ActionListener {
//MySettings is a nested class within VideoSettingsPanel
WBC.setCaptureInterface(new MySettings());
if (WBC.CameraFound()) {
if (WBC.cameraFound()) {
CamFound = true;
list = WBC.getDeviceNames();
......@@ -87,7 +87,7 @@ public class VideoSettingPanel implements ActionListener {
System.out.println("Chosen Camera: " + WBC.getDeviceName(0));
CurrentCameraformat(0);
currentCameraformat(0);
if(list != null)
for (int i = 0; i < list.size(); ++i) {
boxCameras.addItem(list.get(i));
......@@ -162,11 +162,11 @@ public class VideoSettingPanel implements ActionListener {
frame.add(panel, c);
}
public boolean CamerasFound() {
public boolean camerasFound() {
return CamFound;
}
public void CurrentCameraformat(int DeviceID) {
public void currentCameraformat(int DeviceID) {
// updates the CameraModeBox
boxFormat.removeAllItems();
try {
......@@ -247,7 +247,7 @@ public class VideoSettingPanel implements ActionListener {
if (e.getSource() == boxCameras) {
try {
WBC.setSelectedCam(WBC.getDeviceName(boxCameras.getSelectedIndex()));
CurrentCameraformat(boxCameras.getSelectedIndex());
currentCameraformat(boxCameras.getSelectedIndex());
} catch (SetCameraException e1) {
e1.printStackTrace();
}
......@@ -267,7 +267,7 @@ public class VideoSettingPanel implements ActionListener {
if (e.getSource() == butStop) {
try {
WBC.Stop();
WBC.stop();
} catch (CameraStopException e1) {
e1.printStackTrace();
}
......@@ -276,7 +276,7 @@ public class VideoSettingPanel implements ActionListener {
if (e.getSource() == butStart) {
try {
if(WBC.Start()){
if(WBC.start()){
setEnabled(true);
frame.pack();
}
......@@ -292,7 +292,7 @@ public class VideoSettingPanel implements ActionListener {
show(false);
setEnabled(true);
try {
WBC.Stop();
WBC.stop();
} catch (CameraStopException e1) {
e1.printStackTrace();
}
......@@ -301,7 +301,7 @@ public class VideoSettingPanel implements ActionListener {
if (e.getSource() == butApply) {
setEnabled(true);
try {
WBC.Stop();
WBC.stop();
} catch (CameraStopException e1) {
e1.printStackTrace();
}
......
......@@ -46,9 +46,9 @@ public interface WebCamControl {
public float getQuality(); //default quality is 0,1f
public boolean Start() throws CameraStartException; //Starts Capturing images
public boolean start() throws CameraStartException; //Starts Capturing images
public boolean Stop() throws CameraStopException; //Ends Capturing images
public boolean stop() throws CameraStopException; //Ends Capturing images
/**
* needed under Linux
......@@ -58,7 +58,7 @@ public interface WebCamControl {
/**
* @return true if at least one camera detected.
*/
public boolean CameraFound();
public boolean cameraFound();
......
......@@ -116,7 +116,7 @@ public class WindowsCam implements WebCamControl {
}
@Override
public boolean Start() {
public boolean start() {
if (CamFound)
if (!isRecording) {
try {
......@@ -142,7 +142,7 @@ public class WindowsCam implements WebCamControl {
}
@Override
public boolean Stop() {
public boolean stop() {
try {
if (isRecording) {
StartcaptureStream.stop();
......@@ -199,7 +199,7 @@ public class WindowsCam implements WebCamControl {
} // not necessary for WindowsCam
@Override
public boolean CameraFound() {
public boolean cameraFound() {
return CamFound;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment