...
 
Commits (16)
  • Vibhoothi's avatar
    extras: Introuduce new properties for VLC Xcode project · 6b6879b5
    Vibhoothi authored
    This commit introduces various changes to current VLC Xcode project which is essential
    for future development.Also few are done as per Xcode Specification
    6b6879b5
  • Vibhoothi's avatar
    macosx:Introduce VLCMainWindowCollectionViewItem cocoa class with XIB · 56bd830f
    Vibhoothi authored
    This introduction is for making libraryView based on NSCollectionView by default for VLC 4.0
    The following files are newly introduced
     - VLCMainWindowCollectionViewItem.xib : An Interface for showing collectionView items.
     - VLCMainWindowCollectionViewItem.h   : Header file for defining instance and instance variables
     - VLCMainWindowCollectionViewItem.m   : Cococa class which contains implementation of instance and representation of objects
    -  Build VLCMainWindowCollectionViewItem files
    56bd830f
  • Vibhoothi's avatar
    extras: Hello macOS 10.11 · 13ef6287
    Vibhoothi authored
    From VLC 4.0 we are making 10.11 macOS version as minimum specification for having
    libraryView feature and for all who are below 10.11 will have normal VLC without libraryView
    feature
    13ef6287
  • Vibhoothi's avatar
    MainWindow: Introduce libraryView · 5980e67d
    Vibhoothi authored
    - Loads the image from default location which is hardcoded as of now using NSColelctionVIewDataSource and NSFileManager.
    - Uses FlowLayout for showing the items in the collectionView
    - Shows Highlight of selection with blue colour (alternateSelectedControlColor).
    - Get the index of selection using delegate following NSCollectionViewDelegate protocol and for debugging and all have displayed the log of it to command line.
    - Scrolling function is also there with this, when the user resizes Window,it dynamically resizes the collection view items
    5980e67d
  • Vibhoothi's avatar
    libraryView: Add a popOver inside collectionView · 5298b5c7
    Vibhoothi authored
    This commit introduces a minimal popOver with a button into the collectionView aka
    LibraryView which shows all metaData informationd of the video when user clicks the button
    found in collectionViewItem
    5298b5c7
  • Vibhoothi's avatar
    LibraryView: Introduce Thumbinails with videoTitle using ImageGenerator · aa3299f6
    Vibhoothi authored
    Introduces thumbinails to VLC's libraryView which is now loaded from local directory since
    its now using dummyData only not using CoreAPIs.
    This commit also introduces videoTitle field below to video thumbinail in libraryView
    aa3299f6
  • Vibhoothi's avatar
    libraryView:Add and remove constraints of libraryView's Item · 36cc211c
    Vibhoothi authored
    This commit fixses most of constraints issue found in the collectionViewItem's IB
    36cc211c
  • Vibhoothi's avatar
    libraryView:Introduce a dataModel · 0bf55a22
    Vibhoothi authored
    This commits adds a new dataModel to the VLC which essentailly brings us the Model View
    Controller concept ie. seperates dataModel from View and Controlle
    The following are the changes introuduced with this commitr
      - Add Cocoa class VLCMainWindowDataModel which is the dataModel for us
      - Build the dataModel
      - Make changes to the VLC Xcode Project to adapt to the new change
    0bf55a22
  • Vibhoothi's avatar
    libraryView: Fix all constraint issues of libraryView's item · 91240079
    Vibhoothi authored
    This commit fixes the typos and all other issues of the colletionViewItems like
       - Wrong Dimensions of items
       - Wrong flowLayout item size
       - Add and remove few missing constraints
    91240079
  • Vibhoothi's avatar
    libraryView: Minor cleanup of the mainWindow · de3b523e
    Vibhoothi authored
    Cleaned up the VLCMainWinodw class
    de3b523e
  • Felix Paul Kühne's avatar
    macosx: fix position slider appearance (closes #20697) · 1919581e
    Felix Paul Kühne authored
    This fixes a regression introduced in a6e1e1b0
    1919581e
  • Vibhoothi's avatar
    libraryView: MVC based libraryView with dummyData · 4531bbef
    Vibhoothi authored
    This commit fully revamp the current implementation of the dummyData with proper Guidelines
    of MVC so now the data is made into a datamModel and passed to
    VLCMainWindowCollectionViewItem with assignValueForDataModel with dataModel as an argument
    4531bbef
  • Vibhoothi's avatar
    libraryView: Remove multiple instance of dataModel · 264754b3
    Vibhoothi authored
    Earlier we had 3 diffrent dataModel for thumbinail,image and years,now we have only one
    dataModel
    
    To-Do
     - Currently values is added to array which is being replaced instead of adding which
    dataModel to repeat valeus
     - Fix up passing the dataModel to collectionViewItem
    264754b3
  • Vibhoothi's avatar
    libraryView:Standarization of class Names · 6224bf17
    Vibhoothi authored
    During initial development of libraryView we made the cocoa classes names with
    non-standerized names without proper Naming Conventions
    VLCMainWindowCollectionViewItem -> VLCLibraryView
    VLCMainWindowDataModel -> VLCLibraryItem
    6224bf17
  • Vibhoothi's avatar
    libraryView:Use only single instance of dataModel · 29278198
    Vibhoothi authored
    Make and use only one instance of dataModel for showing items inside libraryView
    Following changes were introduced with this
     - This fixes the regression of 264754b3
     - Also now the performance of loading is increased a bit
     - Did a minor cleanup of VLCMainWindow
     - Also fixes the issue of not laoding thumbnail and videoTitle inside popOver
    29278198
  • Vibhoothi's avatar
    libraryView:Final cleanup and Ready-to use · d6343816
    Vibhoothi authored
    This is the final cleanup of the codebase
    - Added pragma-marks to the classes for more readability
    - Reordered code in mainWindow in favour to the pragma-marks
    d6343816
......@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
1106202421197CC6000039A8 /* VLCLibraryItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 1106202321197CC5000039A8 /* VLCLibraryItem.m */; };
11CE023120DBFE42008B0A7F /* VLCLibraryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 11CE022F20DBFE41008B0A7F /* VLCLibraryView.m */; };
1C1C62011F8260A90052DD4F /* VLCWrappableTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C1C62001F8260A90052DD4F /* VLCWrappableTextField.m */; };
1C31138E1E508C6900D4DD76 /* VLCAboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C67C8A71D58C0A40079E1C1 /* VLCAboutWindowController.m */; };
1C3113901E508C6900D4DD76 /* VLCHelpWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C67C8A41D58C0980079E1C1 /* VLCHelpWindowController.m */; };
......@@ -137,6 +139,11 @@
089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1106202221197CC5000039A8 /* VLCLibraryItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryItem.h; sourceTree = "<group>"; };
1106202321197CC5000039A8 /* VLCLibraryItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryItem.m; 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>"; };
11CE023020DBFE42008B0A7F /* VLCLibraryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryView.xib; sourceTree = "<group>"; };
1C06F2A21F08F1250068846F /* osx_notifications.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = osx_notifications.m; path = ../../../modules/notify/osx_notifications.m; sourceTree = "<group>"; };
1C18BE461F2926700053D329 /* keychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = keychain.m; path = ../../../modules/keystore/keychain.m; sourceTree = "<group>"; };
1C1C61FF1F8260A90052DD4F /* VLCWrappableTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCWrappableTextField.h; sourceTree = "<group>"; };
......@@ -628,6 +635,17 @@
name = "Other Frameworks";
sourceTree = "<group>";
};
11CC2FBA211068490091B834 /* LibraryView */ = {
isa = PBXGroup;
children = (
1106202221197CC5000039A8 /* VLCLibraryItem.h */,
1106202321197CC5000039A8 /* VLCLibraryItem.m */,
11CE022E20DBFE41008B0A7F /* VLCLibraryView.h */,
11CE022F20DBFE41008B0A7F /* VLCLibraryView.m */,
);
name = LibraryView;
sourceTree = "<group>";
};
19C28FB8FE9D52D311CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
......@@ -1055,6 +1073,7 @@
7D349C9320CBC770003359A1 /* Main Window */ = {
isa = PBXGroup;
children = (
11CC2FBA211068490091B834 /* LibraryView */,
E0382C00160BA09E0031D7FF /* VLCControlsBarCommon.h */,
E0382C01160BA09E0031D7FF /* VLCControlsBarCommon.m */,
7D5678EE1D5BA397002698F3 /* VLCMainWindowControlsBar.h */,
......@@ -1409,6 +1428,7 @@
children = (
6B8224091E4D2A9000833BE1 /* MainMenu.xib */,
6B82240A1E4D2A9000833BE1 /* MainWindow.xib */,
11CE023020DBFE42008B0A7F /* VLCLibraryView.xib */,
6B82241A1E4D2A9000833BE1 /* VLCStatusBarIconMainMenu.xib */,
6B8224181E4D2A9000833BE1 /* VLCFullScreenPanel.xib */,
6B8223FE1E4D2A8F00833BE1 /* About.xib */,
......@@ -1464,7 +1484,7 @@
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0940;
TargetAttributes = {
1CCB5F2E1A62A6A5004C3E90 = {
CreatedOnToolsVersion = 6.1.1;
......@@ -1556,6 +1576,7 @@
1C31139F1E508C6900D4DD76 /* VLCMainWindowControlsBar.m in Sources */,
1C3113A11E508C6900D4DD76 /* VLCConvertAndSaveWindowController.m in Sources */,
1C3113A31E508C6900D4DD76 /* VLCCoreDialogProvider.m in Sources */,
11CE023120DBFE42008B0A7F /* VLCLibraryView.m in Sources */,
6B2EFC631F281A0900F3C0EA /* VLCVolumeSliderCell.m in Sources */,
1C3113A51E508C6900D4DD76 /* VLCCoreInteraction.m in Sources */,
1C3113A71E508C6900D4DD76 /* VLCLogWindowController.m in Sources */,
......@@ -1582,6 +1603,7 @@
1C3113CD1E508C6900D4DD76 /* VLCPLModel.m in Sources */,
1C3113CF1E508C6900D4DD76 /* prefs_widgets.m in Sources */,
1C3113D11E508C6900D4DD76 /* prefs.m in Sources */,
1106202421197CC6000039A8 /* VLCLibraryItem.m in Sources */,
1C3113D31E508C6900D4DD76 /* VLCResumeDialogController.m in Sources */,
1C5716AC1F5B142200678627 /* coreaudio_common.c in Sources */,
1C3113D51E508C6900D4DD76 /* VLCTextfieldPanelController.m in Sources */,
......@@ -1638,6 +1660,7 @@
"-framework",
Sparkle,
);
PRODUCT_BUNDLE_IDENTIFIER = org.videolan.vlc;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
......@@ -1672,6 +1695,7 @@
"-framework",
Sparkle,
);
PRODUCT_BUNDLE_IDENTIFIER = org.videolan.vlc;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
......@@ -1706,6 +1730,7 @@
"-framework",
Sparkle,
);
PRODUCT_BUNDLE_IDENTIFIER = org.videolan.vlc;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
......@@ -1715,12 +1740,20 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
......@@ -1757,12 +1790,20 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
......@@ -1797,12 +1838,20 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
......
......@@ -13,7 +13,7 @@ source "$SCRIPTDIR/env.build.sh" "none"
ARCH="x86_64"
MINIMAL_OSX_VERSION="10.10"
MINIMAL_OSX_VERSION="10.11"
SDKROOT=$(xcrun --show-sdk-path)
VLCBUILDDIR=""
......
......@@ -35,7 +35,7 @@ OPTIONS="
--disable-pulse
--disable-sdl-image
--disable-vnc
--with-macosx-version-min=10.10
--with-macosx-version-min=10.11
"
export CFLAGS
......
......@@ -94,8 +94,9 @@ libmacosx_plugin_la_SOURCES = \
gui/macosx/VLCSliderCell.h gui/macosx/VLCSliderCell.m \
gui/macosx/VLCVolumeSlider.h gui/macosx/VLCVolumeSlider.m \
gui/macosx/VLCVolumeSliderCell.h gui/macosx/VLCVolumeSliderCell.m \
gui/macosx/VLCWrappableTextField.h gui/macosx/VLCWrappableTextField.m
gui/macosx/VLCWrappableTextField.h gui/macosx/VLCWrappableTextField.m \
gui/macosx/VLCLibraryView.h gui/macosx/VLCLibraryView.m \
gui/macosx/VLCLibraryItem.h gui/macosx/VLCLibraryItem.m
# User interface compilation
......@@ -126,7 +127,8 @@ nodist_libmacosx_plugin_la_SOURCES = \
gui/macosx/UI/TimeSelectionPanel.nib \
gui/macosx/UI/VideoEffects.nib \
gui/macosx/UI/VLCFullScreenPanel.nib \
gui/macosx/UI/VLCStatusBarIconMainMenu.nib
gui/macosx/UI/VLCStatusBarIconMainMenu.nib \
gui/macosx/UI/VLCLibraryView.nib
EXTRA_DIST += \
gui/macosx/UI/About.xib \
......@@ -155,7 +157,8 @@ EXTRA_DIST += \
gui/macosx/UI/TimeSelectionPanel.xib \
gui/macosx/UI/VideoEffects.xib \
gui/macosx/UI/VLCFullScreenPanel.xib \
gui/macosx/UI/VLCStatusBarIconMainMenu.xib
gui/macosx/UI/VLCStatusBarIconMainMenu.xib \
gui/macosx/UI/VLCLibraryView.xib
xib_verbose = $(xib_verbose_$(V))
xib_verbose_ = $(xib_verbose__$(AM_DEFAULT_VERBOSITY))
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14269.12"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
......@@ -17,7 +17,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" topStrut="YES"/>
<rect key="contentRect" x="53" y="419" width="716" height="333"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="900"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="716" height="333"/>
<autoresizingMask key="autoresizingMask"/>
......@@ -25,16 +25,16 @@
<customView translatesAutoresizingMaskIntoConstraints="NO" id="3Bj-Gx-5iu" userLabel="Middle Content">
<rect key="frame" x="0.0" y="36" width="716" height="297"/>
<subviews>
<scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Ke-Vb-9dU">
<scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Ke-Vb-9dU">
<rect key="frame" x="0.0" y="0.0" width="716" height="297"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="V1V-11-Tss">
<rect key="frame" x="1" y="1" width="714" height="295"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView id="9My-dJ-ffm">
<rect key="frame" x="0.0" y="0.0" width="714" height="158"/>
<collectionView selectable="YES" id="9My-dJ-ffm">
<rect key="frame" x="0.0" y="0.0" width="714" height="295"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
<color key="primaryBackgroundColor" name="systemGreenColor" catalog="System" colorSpace="catalog"/>
<color key="primaryBackgroundColor" red="0.48883186943438339" green="0.52322152074126116" blue="0.52881107233502544" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<outlet property="itemPrototype" destination="jCi-fI-3Z2" id="hDE-WR-6dZ"/>
</connections>
......@@ -42,7 +42,7 @@
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="EAD-vz-amF">
<rect key="frame" x="1" y="144" width="233" height="15"/>
<rect key="frame" x="-100" y="-100" width="233" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="CoO-yc-KK4">
......@@ -406,15 +406,7 @@
<outlet property="volumeUpButton" destination="3652" id="vXR-KC-L2N"/>
</connections>
</customObject>
<collectionViewItem id="jCi-fI-3Z2">
<connections>
<outlet property="view" destination="LL0-re-ZbQ" id="mmD-XP-2Sr"/>
</connections>
</collectionViewItem>
<view id="LL0-re-ZbQ">
<rect key="frame" x="0.0" y="0.0" width="100" height="100"/>
<autoresizingMask key="autoresizingMask"/>
</view>
<collectionViewItem id="jCi-fI-3Z2"/>
</objects>
<resources>
<image name="backward-6btns" width="28" height="23"/>
......
This diff is collapsed.
/*****************************************************************************
* VLCLibraryItem.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 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 VLCLibraryItem : NSObject
@property (strong) NSString *videoTitle;
@property (strong) NSString *year;
@property (strong) NSString *length;
@property (strong) NSImage *thumbnail;
@end
/*****************************************************************************
* VLCLibraryItem.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 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 "VLCLibraryItem.h"
@implementation VLCLibraryItem
@end
/*****************************************************************************
* VLCLibraryView.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 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 <Cocoa/Cocoa.h>
#import "VLCLibraryItem.h"
@interface VLCLibraryView : NSCollectionViewItem < NSCollectionViewDelegate>
//Library View
@property (nonatomic,strong) IBOutlet NSImageView *VLCItemImageView;
@property (strong) IBOutlet NSPopover *VLCPopOver;
@property (strong) IBOutlet NSButton *VLCPopOverTriggerButton;
@property (nonatomic,strong) IBOutlet NSTextField *VLCItemLabel;
//PopOver View
@property (strong) IBOutlet NSImageView *popOverImage;
@property (strong) IBOutlet NSTextField *popOverTitle;
@property (strong) IBOutlet NSTextField *popOverYear;
@property (strong) IBOutlet NSTextField *popOverSize;
//method for linking dataModel with View
-(void)assignValueForDataModel:(VLCLibraryItem *) dataModel;
@end
/*****************************************************************************
* VLCLibraryView.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 <Cocoa/Cocoa.h>
#import "VLCLibraryView.h"
#import "VLCLibraryItem.h"
@interface VLCLibraryView ()
{
}
@end
@implementation VLCLibraryView
- (void)viewDidLoad {
[super viewDidLoad];
[self.collectionView setDelegate:self];
}
#pragma mark - dataModel and View handling
/*
Assigning values from the dataModel to the view fields like
- Thumbnail
- Video Title
- Fields in the popOver where diffrent metadatas are shown
- Small thumbnail
- Title of the video
- Size of the video
- Year of the video
*/
-(void)assignValueForDataModel:(VLCLibraryItem *) dataModel
{
self.VLCItemLabel.stringValue = dataModel.videoTitle;;
self.VLCItemImageView.image = dataModel.thumbnail;
self.popOverYear.stringValue = dataModel.year;
self.popOverImage.image = self.VLCItemImageView.image;
self.popOverTitle.stringValue = self.VLCItemLabel.stringValue;
self.popOverSize.stringValue= dataModel.length;
}
#pragma mark - Selection Highlighting in the libraryView
- (void)setSelected:(BOOL)flag
{
[super setSelected:flag];
[self updateBackgroundColorForSelectionState:flag];
}
- (void) viewDidAppear
{
[self updateBackgroundColorForSelectionState:self.isSelected];
}
- (void)updateBackgroundColorForSelectionState:(BOOL)flag
{
if (flag)
{
self.view.layer.backgroundColor = [[NSColor alternateSelectedControlColor] CGColor];
}
else
{
self.view.layer.backgroundColor = [[NSColor clearColor] CGColor];
}
}
#pragma mark - popOver Initialisation of the indexed files
- (BOOL)buttonIsPressed
{
return self.VLCPopOverTriggerButton.intValue == 1;
}
- (IBAction)popOver:(id)sender {
NSLog(@"VLC: Popup tapped");
if (self.buttonIsPressed)
{
[self.VLCPopOver showRelativeToRect:[self.VLCPopOverTriggerButton bounds] ofView:self.VLCPopOverTriggerButton preferredEdge:NSMaxYEdge];
} else {
[self.VLCPopOver close];
}
}
@end
......@@ -26,13 +26,15 @@
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import <AVFoundation/AVFoundation.h>
#import <vlc_input.h>
#import <vlc_vout_window.h>
#import "VLCVideoWindowCommon.h"
#import "misc.h"
#import "VLCFSPanelController.h"
#import "VLCLibraryView.h"
#import "VLCLibraryItem.h"
@class VLCDetachedVideoWindow;
@class VLCMainWindowControlsBar;
......@@ -49,10 +51,13 @@ typedef enum {
@property (readonly) BOOL nativeFullscreenMode;
@property (readwrite) BOOL nonembedded;
@property (weak) IBOutlet NSCollectionView *collectionView;
@property (strong) VLCLibraryItem *dataModel;
@property (strong) NSMutableArray *dummyData;
@property (readonly) VLCFSPanelController* fspanel;
@property (nonatomic, copy) NSDictionary *overrideClassNames;
@property (strong) IBOutlet NSCollectionView *collectionView;
@property (readonly) VLCFSPanelController* fspanel;
- (void)changePlaylistState:(VLCPlaylistStateEvent)event;
......
......@@ -45,15 +45,14 @@
#import "VLCVoutView.h"
#import "VLCVideoOutputProvider.h"
@interface VLCMainWindow() <NSWindowDelegate, NSAnimationDelegate>
@interface VLCMainWindow() <NSWindowDelegate, NSAnimationDelegate, NSCollectionViewDelegate,NSCollectionViewDataSource>
{
BOOL videoPlaybackEnabled;
BOOL dropzoneActive;
BOOL minimizedView;
BOOL collectionViewRemoved;
NSSet<NSIndexPath *> * VLCLibraryViewItem;
CGFloat lastCollectionViewHeight;
NSRect frameBeforePlayback;
}
@end
......@@ -132,8 +131,14 @@ static const float f_min_window_height = 307.;
/* update fs button to reflect state for next startup */
if (var_InheritBool(pl_Get(getIntf()), "fullscreen"))
[self.controlsBar setFullscreenState:YES];
/* Initialise collectionview when Player loads */
[self makeCollectionViewVisible];
[self.collectionView reloadData];
}
#pragma mark - key and event handling
- (BOOL)isEvent:(NSEvent *)o_event forKey:(const char *)keyString
......@@ -182,8 +187,8 @@ static const float f_min_window_height = 307.;
[coreInteraction keyEvent:o_event];
}
#pragma mark - data view vs video output handling
#pragma mark - LibraryView
#pragma mark data view vs video output handling
- (void)makeCollectionViewVisible
{
[self setContentMinSize: NSMakeSize(604., f_min_window_height)];
......@@ -206,24 +211,146 @@ static const float f_min_window_height = 307.;
}
[self makeFirstResponder:_collectionView];
self.dummyData=[NSMutableArray arrayWithCapacity:0 ];
self.collectionView.wantsLayer = YES;
[self prepareData];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.wantsLayer = YES;
[self.collectionView registerClass:[VLCLibraryView class] forItemWithIdentifier:@"dummyViews"];
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.collectionView.collectionViewLayout = flowLayout;
[self.collectionView reloadData];
}
// Hides the collection view and makes the vout view in foreground
- (void)makeCollectionViewHidden
{
[self setContentMinSize: NSMakeSize(604., f_min_video_height)];
[_collectionView setHidden:YES];
[self.videoView setHidden:NO];
if (self.nativeFullscreenMode && [self fullscreen]) {
[self hideControlsBar];
[self.fspanel setActive];
}
if ([[self.videoView subviews] count] > 0)
[self makeFirstResponder: [[self.videoView subviews] firstObject]];
}
- (void)hideCollectionView:(BOOL)resize
{
if (resize) {
NSRect winrect = [self frame];
lastCollectionViewHeight = [_collectionView frame].size.height;
winrect.size.height = winrect.size.height - lastCollectionViewHeight;
winrect.origin.y = winrect.origin.y + lastCollectionViewHeight;
[self setFrame:winrect display:YES animate:YES];
}
[self setContentMinSize: NSMakeSize(604., [self.controlsBar height])];
[self setContentMaxSize: NSMakeSize(FLT_MAX, [self.controlsBar height])];
collectionViewRemoved = YES;
}
- (void)showCollectionView:(BOOL)resize
{
[self updateWindow];
[self setContentMinSize:NSMakeSize(604., f_min_window_height)];
[self setContentMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
if (resize) {
NSRect winrect;
winrect = [self frame];
winrect.size.height = winrect.size.height + lastCollectionViewHeight;
winrect.origin.y = winrect.origin.y - lastCollectionViewHeight;
[self setFrame:winrect display:YES animate:YES];
}
collectionViewRemoved = NO;
}
#pragma mark Generating dummyData for the libraryView
/*
Assigning values from local source to the dataModel
*/
- (void)prepareData {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *rootPath = @"/Users/vibhoothiiaanand/Desktop/dummyVideos";
NSError *error = nil;
NSArray *paths = [fileManager contentsOfDirectoryAtPath:rootPath error:&error];
for(NSString *path in paths){
NSString *videoPath = [rootPath stringByAppendingFormat:@"/%@",path];
NSLog(@"Video Path:%@",videoPath);
NSURL *url = [NSURL fileURLWithPath:videoPath];
AVAsset *asset = [AVAsset assetWithURL:url];
AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc]initWithAsset:asset];
imageGenerator.appliesPreferredTrackTransform=YES;
CMTime time = [asset duration];
time.value = 0;
float duration = CMTimeGetSeconds([asset duration]);
CGImageRef imgRef = [imageGenerator copyCGImageAtTime:CMTimeMake(10, duration) actualTime:NULL error:nil];
NSImage *thumbinail =[[NSImage alloc] initWithCGImage:imgRef size:NSSizeFromCGSize(CGSizeMake(100.0, 100.0))];
if(thumbinail){
self.dataModel = [[VLCLibraryItem alloc] init ] ;
self.dataModel.thumbnail = thumbinail;
self.dataModel.videoTitle= path;
self.dataModel.year = @"2012";
self.dataModel.length = @"40.4 MB";
[self.dummyData addObject:self.dataModel] ;
}
}
NSLog(@"DataModel dummy %@",self.dummyData);
}
#pragma mark libraryView generation using modern APIs
- (NSSet<NSIndexPath *> *)collectionView:(NSCollectionView *)collectionView shouldChangeItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths toHighlightState:(NSCollectionViewItemHighlightState)highlightState {
return indexPaths;
}
- (void)collectionView:(NSCollectionView *)collectionView didSelectItemsAtIndexPaths:VLCLibraryViewItem
{
NSLog(@"Video at:%@ is Selected",VLCLibraryViewItem);
//Hide the CollectionView in favour of playing video when user clicks
[self performSelector:@selector(makeCollectionViewHidden) withObject:self afterDelay:2.0 ];
/*
Insert code for playing Video using libVLCCore
*/
}
- (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.dummyData.count;
}
- (NSCollectionViewItem *)collectionView:(NSCollectionView *)collectionView itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath
{
/*
Pass the metadata to the DataModel for assinging values to the views
and return updated view
*/
VLCLibraryView *item = [collectionView makeItemWithIdentifier:@"dummyViews" forIndexPath:indexPath];
VLCLibraryItem *libraryItem = [self.dummyData objectAtIndex:indexPath.item];
[item assignValueForDataModel:libraryItem];
return item;
}
- (NSInteger)numberOfSectionsInCollectionView:(NSCollectionView *)collectionView {
return 1;
}
#pragma mark -
#pragma mark Playlist State toggle
- (void)changePlaylistState:(VLCPlaylistStateEvent)event
{
// Beware, this code is really ugly
......@@ -283,39 +410,6 @@ static const float f_min_window_height = 307.;
msg_Dbg(getIntf(), "toggle playlist to state: removed collectionview %i, minimized view %i", collectionViewRemoved, minimizedView);
}
- (void)hideCollectionView:(BOOL)resize
{
if (resize) {
NSRect winrect = [self frame];
lastCollectionViewHeight = [_collectionView frame].size.height;
winrect.size.height = winrect.size.height - lastCollectionViewHeight;
winrect.origin.y = winrect.origin.y + lastCollectionViewHeight;
[self setFrame:winrect display:YES animate:YES];
}
[self setContentMinSize: NSMakeSize(604., [self.controlsBar height])];
[self setContentMaxSize: NSMakeSize(FLT_MAX, [self.controlsBar height])];
collectionViewRemoved = YES;
}
- (void)showCollectionView:(BOOL)resize
{
[self updateWindow];
[self setContentMinSize:NSMakeSize(604., f_min_window_height)];
[self setContentMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
if (resize) {
NSRect winrect;
winrect = [self frame];
winrect.size.height = winrect.size.height + lastCollectionViewHeight;
winrect.origin.y = winrect.origin.y - lastCollectionViewHeight;
[self setFrame:winrect display:YES animate:YES];
}
collectionViewRemoved = NO;
}
#pragma mark -
#pragma mark overwritten default window functionality
......
......@@ -393,9 +393,10 @@ FREENULL( psz_##foo );
return @"";
if ([[tableColumn identifier] isEqualToString:@"0"])
return [item name];
return [(VLCInfoTreeItem *)item name];
else
return [item value];
return [(VLCInfoTreeItem *) item value];
}
@end
......
......@@ -203,6 +203,11 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
[NSGraphicsContext restoreGraphicsState];
}
- (NSRect)barRectFlipped:(BOOL)flipped
{
return [[self controlView] bounds];
}
- (void)drawBarInside:(NSRect)rect flipped:(BOOL)flipped
{
// Inset rect
......