Skip to content
Snippets Groups Projects
Commit e7a604c1 authored by Alexandre Lision's avatar Alexandre Lision Committed by Edric Milaret
Browse files

video: adjust to source model modification

Related to change #3155

Change-Id: I08a1f5dfeff25702212a25f829cb0e73f92d5a4a
Tuleap: #188
parent 4d9905e3
Branches
Tags
No related merge requests found
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#import <video/configurationproxy.h> #import <video/configurationproxy.h>
#import <video/sourcemodel.h> #import <video/sourcemodel.h>
#import <media/video.h>
#import <callmodel.h>
#import <video/previewmanager.h> #import <video/previewmanager.h>
#import <video/renderer.h> #import <video/renderer.h>
#import <video/device.h> #import <video/device.h>
...@@ -161,10 +163,15 @@ ...@@ -161,10 +163,15 @@
--------------------------------------------------------*/ --------------------------------------------------------*/
if ( [sender draggingSource] != self ) { if ( [sender draggingSource] != self ) {
NSURL* fileURL = [NSURL URLFromPasteboard: [sender draggingPasteboard]]; NSURL* fileURL = [NSURL URLFromPasteboard: [sender draggingPasteboard]];
Video::SourceModel::instance().setFile(QUrl::fromLocalFile(QString::fromUtf8([fileURL.path UTF8String]))); if (auto current = CallModel::instance().selectedCall()) {
if (auto outVideo = current->firstMedia<Media::Video>(Media::Media::Direction::OUT)) {
outVideo->sourceModel()->setFile(QUrl::fromLocalFile(QString::fromUtf8([fileURL.path UTF8String])));
return YES;
}
}
} }
return YES; return NO;
} }
- (void)showContextualMenu:(NSEvent *)theEvent { - (void)showContextualMenu:(NSEvent *)theEvent {
...@@ -219,7 +226,11 @@ ...@@ -219,7 +226,11 @@
- (void) switchInput:(NSMenuItem*) sender - (void) switchInput:(NSMenuItem*) sender
{ {
int index = [contextualMenu indexOfItem:sender]; int index = [contextualMenu indexOfItem:sender];
Video::SourceModel::instance().switchTo(Video::DeviceModel::instance().devices()[index]); if (auto current = CallModel::instance().selectedCall()) {
if (auto outVideo = current->firstMedia<Media::Video>(Media::Media::Direction::OUT)) {
outVideo->sourceModel()->switchTo(Video::DeviceModel::instance().devices()[index]);
}
}
} }
- (void) chooseFile:(NSMenuItem*) sender - (void) chooseFile:(NSMenuItem*) sender
...@@ -240,7 +251,11 @@ ...@@ -240,7 +251,11 @@
[browsePanel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) { [browsePanel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) {
if (result == NSFileHandlingPanelOKButton) { if (result == NSFileHandlingPanelOKButton) {
NSURL* theDoc = [[browsePanel URLs] objectAtIndex:0]; NSURL* theDoc = [[browsePanel URLs] objectAtIndex:0];
Video::SourceModel::instance().setFile(QUrl::fromLocalFile(QString::fromUtf8([theDoc.path UTF8String]))); if (auto current = CallModel::instance().selectedCall()) {
if (auto outVideo = current->firstMedia<Media::Video>(Media::Media::Direction::OUT)) {
outVideo->sourceModel()->setFile(QUrl::fromLocalFile(QString::fromUtf8([theDoc.path UTF8String])));
}
}
} }
}]; }];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment