Commit 40940702 authored by Vibhoothi's avatar Vibhoothi

playQueue: Minor Improvements

This commits includes many WIP and broken things which is not advised to take up.
 = Introduces new VLCPlayQueueItem which is essentially the dataModel for the
playQueue
 - Adds a function to add to playQueue which is broken as_of_now
 - Rearranged some functions in favour of more clean approach of the
implementation of playQueue
parent e04568eb
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1106202421197CC6000039A8 /* VLCLibraryItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 1106202321197CC5000039A8 /* VLCLibraryItem.m */; }; 1106202421197CC6000039A8 /* VLCLibraryItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 1106202321197CC5000039A8 /* VLCLibraryItem.m */; };
111F330B214821D100A576E9 /* VLCPlayQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 111F3309214821D100A576E9 /* VLCPlayQueue.m */; }; 111F330B214821D100A576E9 /* VLCPlayQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 111F3309214821D100A576E9 /* VLCPlayQueue.m */; };
119BCE8F214C40500089BCA6 /* VLCPlayQueueItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 119BCE8E214C40500089BCA6 /* VLCPlayQueueItem.m */; };
11CE023120DBFE42008B0A7F /* VLCLibraryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 11CE022F20DBFE41008B0A7F /* VLCLibraryView.m */; }; 11CE023120DBFE42008B0A7F /* VLCLibraryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 11CE022F20DBFE41008B0A7F /* VLCLibraryView.m */; };
1C1C62011F8260A90052DD4F /* VLCWrappableTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1C62001F8260A90052DD4F /* VLCWrappableTextField.m */; }; 1C1C62011F8260A90052DD4F /* VLCWrappableTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1C62001F8260A90052DD4F /* VLCWrappableTextField.m */; };
1C31138E1E508C6900D4DD76 /* VLCAboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C67C8A71D58C0A40079E1C1 /* VLCAboutWindowController.m */; }; 1C31138E1E508C6900D4DD76 /* VLCAboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C67C8A71D58C0A40079E1C1 /* VLCAboutWindowController.m */; };
...@@ -145,6 +146,8 @@ ...@@ -145,6 +146,8 @@
111F3308214821D100A576E9 /* VLCPlayQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlayQueue.h; sourceTree = "<group>"; }; 111F3308214821D100A576E9 /* VLCPlayQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlayQueue.h; sourceTree = "<group>"; };
111F3309214821D100A576E9 /* VLCPlayQueue.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCPlayQueue.m; sourceTree = "<group>"; }; 111F3309214821D100A576E9 /* VLCPlayQueue.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCPlayQueue.m; sourceTree = "<group>"; };
111F330A214821D100A576E9 /* VLCPlayQueue.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCPlayQueue.xib; sourceTree = "<group>"; }; 111F330A214821D100A576E9 /* VLCPlayQueue.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCPlayQueue.xib; sourceTree = "<group>"; };
119BCE8D214C40500089BCA6 /* VLCPlayQueueItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlayQueueItem.h; sourceTree = "<group>"; };
119BCE8E214C40500089BCA6 /* VLCPlayQueueItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCPlayQueueItem.m; sourceTree = "<group>"; };
11CE022E20DBFE41008B0A7F /* VLCLibraryView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryView.h; sourceTree = "<group>"; }; 11CE022E20DBFE41008B0A7F /* VLCLibraryView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryView.h; sourceTree = "<group>"; };
11CE022F20DBFE41008B0A7F /* VLCLibraryView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryView.m; sourceTree = "<group>"; }; 11CE022F20DBFE41008B0A7F /* VLCLibraryView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryView.m; sourceTree = "<group>"; };
11CE023020DBFE42008B0A7F /* VLCLibraryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryView.xib; sourceTree = "<group>"; }; 11CE023020DBFE42008B0A7F /* VLCLibraryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryView.xib; sourceTree = "<group>"; };
...@@ -644,6 +647,8 @@ ...@@ -644,6 +647,8 @@
children = ( children = (
111F3308214821D100A576E9 /* VLCPlayQueue.h */, 111F3308214821D100A576E9 /* VLCPlayQueue.h */,
111F3309214821D100A576E9 /* VLCPlayQueue.m */, 111F3309214821D100A576E9 /* VLCPlayQueue.m */,
119BCE8D214C40500089BCA6 /* VLCPlayQueueItem.h */,
119BCE8E214C40500089BCA6 /* VLCPlayQueueItem.m */,
); );
name = PlayQueue; name = PlayQueue;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1631,6 +1636,7 @@ ...@@ -1631,6 +1636,7 @@
1C3113DD1E508C6900D4DD76 /* VLCTrackSynchronizationWindowController.m in Sources */, 1C3113DD1E508C6900D4DD76 /* VLCTrackSynchronizationWindowController.m in Sources */,
6B6FFF701EF9EC350001CEB1 /* CompatibilityFixes.m in Sources */, 6B6FFF701EF9EC350001CEB1 /* CompatibilityFixes.m in Sources */,
111F330B214821D100A576E9 /* VLCPlayQueue.m in Sources */, 111F330B214821D100A576E9 /* VLCPlayQueue.m in Sources */,
119BCE8F214C40500089BCA6 /* VLCPlayQueueItem.m in Sources */,
1C3113DF1E508C6900D4DD76 /* VLCVideoEffectsWindowController.m in Sources */, 1C3113DF1E508C6900D4DD76 /* VLCVideoEffectsWindowController.m in Sources */,
1C3113E11E508C6900D4DD76 /* VLCVoutView.m in Sources */, 1C3113E11E508C6900D4DD76 /* VLCVoutView.m in Sources */,
1C3113E31E508C6900D4DD76 /* VLCPlaylist.m in Sources */, 1C3113E31E508C6900D4DD76 /* VLCPlaylist.m in Sources */,
......
...@@ -77,11 +77,11 @@ ...@@ -77,11 +77,11 @@
</connections> </connections>
</popover> </popover>
<customView id="LAc-1i-9Rt"> <customView id="LAc-1i-9Rt">
<rect key="frame" x="0.0" y="0.0" width="205" height="107"/> <rect key="frame" x="0.0" y="0.0" width="245" height="136"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews> <subviews>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bNc-32-jG8"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bNc-32-jG8">
<rect key="frame" x="81" y="70" width="106" height="17"/> <rect key="frame" x="121" y="99" width="106" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="ConeyCone.mp4" id="Cdi-hZ-jxs"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="ConeyCone.mp4" id="Cdi-hZ-jxs">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
...@@ -89,11 +89,11 @@ ...@@ -89,11 +89,11 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<imageView translatesAutoresizingMaskIntoConstraints="NO" id="0sa-wu-dPr"> <imageView translatesAutoresizingMaskIntoConstraints="NO" id="0sa-wu-dPr">
<rect key="frame" x="17" y="17" width="61" height="73"/> <rect key="frame" x="5" y="17" width="113" height="102"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="grayBezel" image="VLC" id="1Ko-ZD-RIh"/> <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="grayBezel" image="VLC" id="1Ko-ZD-RIh"/>
</imageView> </imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ebf-j5-UtS"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ebf-j5-UtS">
<rect key="frame" x="81" y="45" width="106" height="17"/> <rect key="frame" x="121" y="74" width="106" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="2018" id="WF4-b6-t4f"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="2018" id="WF4-b6-t4f">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
...@@ -101,20 +101,32 @@ ...@@ -101,20 +101,32 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lSa-IC-VbL"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lSa-IC-VbL">
<rect key="frame" x="81" y="20" width="106" height="17"/> <rect key="frame" x="121" y="49" width="106" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="40404.404" id="sj9-oz-6hS"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="40404.404" id="sj9-oz-6hS">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NZQ-3m-BpI">
<rect key="frame" x="191" y="13" width="40" height="32"/>
<buttonCell key="cell" type="push" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="jeI-yO-Jiz">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="addItemsToPlayQueue:" target="-2" id="IPB-Oc-UQV"/>
</connections>
</button>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="bNc-32-jG8" firstAttribute="top" secondItem="LAc-1i-9Rt" secondAttribute="top" constant="20" symbolic="YES" id="1ET-JM-75A"/> <constraint firstItem="bNc-32-jG8" firstAttribute="top" secondItem="LAc-1i-9Rt" secondAttribute="top" constant="20" symbolic="YES" id="1ET-JM-75A"/>
<constraint firstItem="0sa-wu-dPr" firstAttribute="leading" secondItem="LAc-1i-9Rt" secondAttribute="leading" constant="20" symbolic="YES" id="666-Jk-QXU"/> <constraint firstItem="0sa-wu-dPr" firstAttribute="leading" secondItem="LAc-1i-9Rt" secondAttribute="leading" constant="8" id="666-Jk-QXU"/>
<constraint firstItem="0sa-wu-dPr" firstAttribute="top" secondItem="LAc-1i-9Rt" secondAttribute="top" constant="20" symbolic="YES" id="8pi-bg-rag"/> <constraint firstItem="0sa-wu-dPr" firstAttribute="top" secondItem="LAc-1i-9Rt" secondAttribute="top" constant="20" symbolic="YES" id="8pi-bg-rag"/>
<constraint firstItem="Ebf-j5-UtS" firstAttribute="top" secondItem="bNc-32-jG8" secondAttribute="bottom" constant="8" symbolic="YES" id="DyL-ip-0Yd"/> <constraint firstItem="Ebf-j5-UtS" firstAttribute="top" secondItem="bNc-32-jG8" secondAttribute="bottom" constant="8" symbolic="YES" id="DyL-ip-0Yd"/>
<constraint firstItem="NZQ-3m-BpI" firstAttribute="trailing" secondItem="bNc-32-jG8" secondAttribute="trailing" id="Ew0-75-wtf"/>
<constraint firstItem="lSa-IC-VbL" firstAttribute="leading" secondItem="bNc-32-jG8" secondAttribute="leading" id="HbK-da-iY4"/> <constraint firstItem="lSa-IC-VbL" firstAttribute="leading" secondItem="bNc-32-jG8" secondAttribute="leading" id="HbK-da-iY4"/>
<constraint firstItem="lSa-IC-VbL" firstAttribute="trailing" secondItem="bNc-32-jG8" secondAttribute="trailing" id="Hew-4I-sei"/>
<constraint firstAttribute="bottom" secondItem="0sa-wu-dPr" secondAttribute="bottom" constant="20" symbolic="YES" id="Kso-LA-kIn"/> <constraint firstAttribute="bottom" secondItem="0sa-wu-dPr" secondAttribute="bottom" constant="20" symbolic="YES" id="Kso-LA-kIn"/>
<constraint firstItem="Ebf-j5-UtS" firstAttribute="leading" secondItem="bNc-32-jG8" secondAttribute="leading" id="LGG-d0-q9l"/> <constraint firstItem="Ebf-j5-UtS" firstAttribute="leading" secondItem="bNc-32-jG8" secondAttribute="leading" id="LGG-d0-q9l"/>
<constraint firstItem="bNc-32-jG8" firstAttribute="leading" secondItem="0sa-wu-dPr" secondAttribute="trailing" constant="8" symbolic="YES" id="Pxg-KK-dX5"/> <constraint firstItem="bNc-32-jG8" firstAttribute="leading" secondItem="0sa-wu-dPr" secondAttribute="trailing" constant="8" symbolic="YES" id="Pxg-KK-dX5"/>
...@@ -122,11 +134,12 @@ ...@@ -122,11 +134,12 @@
<constraint firstItem="lSa-IC-VbL" firstAttribute="top" secondItem="Ebf-j5-UtS" secondAttribute="bottom" constant="8" symbolic="YES" id="T8r-ec-OaT"/> <constraint firstItem="lSa-IC-VbL" firstAttribute="top" secondItem="Ebf-j5-UtS" secondAttribute="bottom" constant="8" symbolic="YES" id="T8r-ec-OaT"/>
<constraint firstItem="Ebf-j5-UtS" firstAttribute="leading" secondItem="0sa-wu-dPr" secondAttribute="trailing" constant="8" symbolic="YES" id="UeU-R4-BFq"/> <constraint firstItem="Ebf-j5-UtS" firstAttribute="leading" secondItem="0sa-wu-dPr" secondAttribute="trailing" constant="8" symbolic="YES" id="UeU-R4-BFq"/>
<constraint firstAttribute="trailing" secondItem="bNc-32-jG8" secondAttribute="trailing" constant="20" symbolic="YES" id="UlV-ak-XdR"/> <constraint firstAttribute="trailing" secondItem="bNc-32-jG8" secondAttribute="trailing" constant="20" symbolic="YES" id="UlV-ak-XdR"/>
<constraint firstItem="Ebf-j5-UtS" firstAttribute="trailing" secondItem="bNc-32-jG8" secondAttribute="trailing" id="YHN-eK-O6c"/> <constraint firstAttribute="bottom" secondItem="NZQ-3m-BpI" secondAttribute="bottom" constant="20" symbolic="YES" id="WXG-KU-vLT"/>
<constraint firstAttribute="bottom" secondItem="lSa-IC-VbL" secondAttribute="bottom" constant="20" symbolic="YES" id="d6E-ET-pPI"/> <constraint firstItem="NZQ-3m-BpI" firstAttribute="top" secondItem="lSa-IC-VbL" secondAttribute="bottom" constant="8" symbolic="YES" id="azH-QJ-A49"/>
<constraint firstItem="lSa-IC-VbL" firstAttribute="trailing" secondItem="bNc-32-jG8" secondAttribute="trailing" id="w3N-35-dXI"/> <constraint firstItem="NZQ-3m-BpI" firstAttribute="leading" secondItem="0sa-wu-dPr" secondAttribute="trailing" constant="82" id="gu4-VT-xHX"/>
<constraint firstItem="Ebf-j5-UtS" firstAttribute="trailing" secondItem="bNc-32-jG8" secondAttribute="trailing" id="lS6-5e-Eyg"/>
</constraints> </constraints>
<point key="canvasLocation" x="7.5" y="1278.5"/> <point key="canvasLocation" x="27.5" y="1294"/>
</customView> </customView>
</objects> </objects>
<resources> <resources>
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
//method for linking dataModel with View //method for linking dataModel with View
-(void)assignValueForDataModel:(VLCLibraryItem *) dataModel; -(void)assignValueForDataModel:(VLCLibraryItem *) dataModel;
- (void) addItemToPlayQueue:(NSSet<NSIndexPath *> *) indexPath : (VLCLibraryItem *) dataModel;
@end @end
...@@ -103,6 +103,18 @@ ...@@ -103,6 +103,18 @@
[self.VLCPopOver close]; [self.VLCPopOver close];
} }
} }
//(VLCLibraryItem *) dataModel
- (void) addItemToPlayQueue:(NSSet<NSIndexPath *> *) indexPath : (VLCLibraryItem *) dataModel
{
// NSInteger *test= indexPath.item;
}
- (IBAction) insertItemToPlayQueue:(id)sender {
}
@end @end
......
...@@ -64,6 +64,7 @@ typedef enum { ...@@ -64,6 +64,7 @@ typedef enum {
- (void)changePlaylistState:(VLCPlaylistStateEvent)event; - (void)changePlaylistState:(VLCPlaylistStateEvent)event;
- (void) addItemsToPlayQueue:(NSSet<NSIndexPath *> *) indexPath;
- (void)windowResizedOrMoved:(NSNotification *)notification; - (void)windowResizedOrMoved:(NSNotification *)notification;
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
NSString *rootPath; NSString *rootPath;
NSArray *paths ; NSArray *paths ;
VLCLibraryItem *libraryItem; VLCLibraryItem *libraryItem;
VLCLibraryView *playQueueItem;
} }
@end @end
...@@ -138,6 +139,7 @@ static const float f_min_window_height = 307.; ...@@ -138,6 +139,7 @@ static const float f_min_window_height = 307.;
/* Initialise collectionview when Player loads */ /* Initialise collectionview when Player loads */
[self makeCollectionViewVisible]; [self makeCollectionViewVisible];
[self initPlayQueueView];
[self.collectionView reloadData]; [self.collectionView reloadData];
} }
...@@ -191,6 +193,46 @@ static const float f_min_window_height = 307.; ...@@ -191,6 +193,46 @@ static const float f_min_window_height = 307.;
[coreInteraction keyEvent:o_event]; [coreInteraction keyEvent:o_event];
} }
#pragma mark - Play Queue
#pragma mark popOver Initialisation
- (BOOL)buttonIsPressed
{
return self.playQueueButton.intValue == 1;
}
- (IBAction)popOver:(id)sender {
NSLog(@"VLC: play-Queue tapped");
if (self.buttonIsPressed)
{
[self.playQueuePopOver showRelativeToRect:[self.playQueueButton bounds] ofView:self.playQueueButton preferredEdge:NSMaxYEdge];
} else {
[self.playQueuePopOver close];
}
}
#pragma mark playQueueView
- (void) initPlayQueueView
{
self.playQueueView.wantsLayer = YES;
self.playQueueView.delegate = self;
[self.playQueueView registerClass:[VLCPlayQueue class] forItemWithIdentifier:@"playQueueItems"];
NSCollectionViewFlowLayout *playQueueList = [[NSCollectionViewFlowLayout alloc] init];
playQueueList.itemSize = NSMakeSize( 231, 120);
NSCollectionViewFlowLayout *flowLayout = [[NSCollectionViewFlowLayout alloc] init];
flowLayout.itemSize = NSMakeSize(190,241);
flowLayout.sectionInset = NSEdgeInsetsMake(10, 10, 10, 10);
flowLayout.minimumInteritemSpacing = 20.0;
flowLayout.minimumLineSpacing = 20.0;
self.playQueueView.collectionViewLayout = flowLayout;
[self.playQueueView reloadData];
}
- (void) addItemsToPlayQueue:(NSSet<NSIndexPath *> *) indexPath
{
}
#pragma mark - LibraryView #pragma mark - LibraryView
#pragma mark data view vs video output handling #pragma mark data view vs video output handling
- (void)makeCollectionViewVisible - (void)makeCollectionViewVisible
...@@ -338,7 +380,11 @@ static const float f_min_window_height = 307.; ...@@ -338,7 +380,11 @@ static const float f_min_window_height = 307.;
NSDictionary *dic = [NSDictionary dictionaryWithObject:videoURL forKey:@"ITEM_URL"]; NSDictionary *dic = [NSDictionary dictionaryWithObject:videoURL forKey:@"ITEM_URL"];
NSArray *videoPlayback = [NSArray arrayWithObject:dic]; NSArray *videoPlayback = [NSArray arrayWithObject:dic];
[[[VLCMain sharedInstance] playlist] addPlaylistItems:videoPlayback]; [[[VLCMain sharedInstance] playlist] addPlaylistItems:videoPlayback];
[playQueueItem addItemToPlayQueue:VLCLibraryViewItem :video];
// [self addItemsToPlayQueue:VLCLibraryViewItem];
} }
- (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
...@@ -361,37 +407,6 @@ static const float f_min_window_height = 307.; ...@@ -361,37 +407,6 @@ static const float f_min_window_height = 307.;
return 1; return 1;
} }
#pragma mark - Play Queue
#pragma mark popOver Initialisation
- (BOOL)buttonIsPressed
{
return self.playQueueButton.intValue == 1;
}
- (IBAction)popOver:(id)sender {
NSLog(@"VLC: play-Queue tapped");
if (self.buttonIsPressed)
{
[self.playQueuePopOver showRelativeToRect:[self.playQueueButton bounds] ofView:self.playQueueButton preferredEdge:NSMaxYEdge];
} else {
[self.playQueuePopOver close];
}
}
#pragma mark playQueueView
- (void) initPlayQueueView
{
self.playQueueView.wantsLayer = YES;
self.playQueueView.delegate = self;
[self.playQueueView registerClass:[VLCPlayQueue class] forItemWithIdentifier:@"playQueueItems"];
NSCollectionViewFlowLayout *playQueueList = [[NSCollectionViewFlowLayout alloc] init];
playQueueList.itemSize = NSMakeSize( 231, 120);
// playQueueList.sectionInset
}
#pragma mark - #pragma mark -
#pragma mark Playlist State toggle #pragma mark Playlist State toggle
- (void)changePlaylistState:(VLCPlaylistStateEvent)event - (void)changePlaylistState:(VLCPlaylistStateEvent)event
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*****************************************************************************/ *****************************************************************************/
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import "VLCPlayQueueItem.h"
@interface VLCPlayQueue : NSCollectionViewItem < NSCollectionViewDelegate> @interface VLCPlayQueue : NSCollectionViewItem < NSCollectionViewDelegate>
...@@ -31,4 +32,7 @@ ...@@ -31,4 +32,7 @@
@property (strong) IBOutlet NSTextField *playQueueTitle; @property (strong) IBOutlet NSTextField *playQueueTitle;
@property (strong) IBOutlet NSTextField *playQueueArtistName; @property (strong) IBOutlet NSTextField *playQueueArtistName;
//method for linking dataModel of playQueue with the View
- (void)assignValueForDataModel:(VLCPlayQueueItem *) playQueueDataModel;
@end @end
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
*****************************************************************************/ *****************************************************************************/
#import "VLCPlayQueue.h" #import "VLCPlayQueue.h"
#import "VLCPlayQueueItem.h"
@interface VLCPlayQueue () @interface VLCPlayQueue ()
...@@ -35,4 +37,13 @@ ...@@ -35,4 +37,13 @@
// Do view setup here. // Do view setup here.
} }
-(void)assignValueForDataModel:(VLCPlayQueueItem *) playQueueDataModel
{
self.playQueueImage.image = playQueueDataModel.thumbnail;
self.playQueueTitle.stringValue = playQueueDataModel.videoTitle;
self.playQueueArtistName.stringValue = playQueueDataModel.artistName;
}
@end @end
/*****************************************************************************
* VLCPlayQueueItem.m : MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2018 VLC authors and VideoLAN
* $Id$
*
* Authors: Vibhoothi <vibhoothiiaanand at googlemail dot com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Foundation/Foundation.h>
@interface VLCPlayQueueItem : NSObject
@property (strong) NSString *videoTitle;
@property (strong) NSString *artistName;
@property (strong) NSImage *thumbnail;
@end
/*****************************************************************************
* VLCPlayQueueItem.m : MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2018 VLC authors and VideoLAN
* $Id$
*
* Authors: Vibhoothi <vibhoothiiaanand at googlemail dot com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import "VLCPlayQueueItem.h"
@implementation VLCPlayQueueItem
@end
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