Added better tooltip feedback.

CQTexperiment
vspader 2009-02-09 05:53:38 +00:00
parent 081ca505dc
commit c9e542f570
13 changed files with 428 additions and 57 deletions

View File

@ -259,13 +259,6 @@
- (IBAction)changeVolume:(id)sender
{
double oneLog = logarithmicToLinear(100.0);
double distance = [sender frame].size.height*([sender doubleValue] - oneLog)/100.0;
if (fabs(distance) < 2.0)
{
[sender setDoubleValue:oneLog];
}
NSLog(@"VOLUME: %lf, %lf", [sender doubleValue], linearToLogarithmic([sender doubleValue]));
[audioPlayer setVolume:linearToLogarithmic([sender doubleValue])];

View File

@ -7,7 +7,7 @@
*
*/
#define MAX_VOLUME 400
#define MAX_VOLUME 400.0
double logarithmicToLinear(double logarithmic);
double linearToLogarithmic(double linear);

View File

@ -22,6 +22,6 @@ double logarithmicToLinear(double logarithmic)
double linearToLogarithmic(double linear)
{
return (linear/100) * (linear/100) * (linear/100) * (linear/100) * MAX_VOLUME;
return (linear/100.0) * (linear/100.0) * (linear/100.0) * (linear/100.0) * MAX_VOLUME;
}
//End helper volume function thingies. ONWARDS TO GLORY!

View File

@ -24,6 +24,9 @@
173855FF0E0CC81F00488CD4 /* FileTreeOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 173855FE0E0CC81F00488CD4 /* FileTreeOutlineView.m */; };
1738589B0E0D92DD00488CD4 /* SideBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 173858950E0D92DD00488CD4 /* SideBarController.m */; };
1738589D0E0D92DD00488CD4 /* SideWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 173858990E0D92DD00488CD4 /* SideWindowController.m */; };
173A43A10F3FD26500676A7B /* ToolTipWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 173A43A00F3FD26500676A7B /* ToolTipWindow.m */; };
173A43B80F3FD3B200676A7B /* VolumeButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 173A43B70F3FD3B200676A7B /* VolumeButton.m */; };
1752C6B00F3FE3CC00FC3235 /* VolumeSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 1752C6AF0F3FE3CC00FC3235 /* VolumeSlider.m */; };
1755E1F90BA0D2B600CA3560 /* PlaylistLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1755E1F70BA0D2B600CA3560 /* PlaylistLoader.m */; };
1766C6930B911DF1004A7AE4 /* AudioScrobbler.m in Sources */ = {isa = PBXBuildFile; fileRef = 1766C68F0B911DF1004A7AE4 /* AudioScrobbler.m */; };
1766C6950B911DF1004A7AE4 /* AudioScrobblerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 1766C6910B911DF1004A7AE4 /* AudioScrobblerClient.m */; };
@ -524,6 +527,12 @@
173858950E0D92DD00488CD4 /* SideBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SideBarController.m; path = SideView/SideBarController.m; sourceTree = "<group>"; };
173858980E0D92DD00488CD4 /* SideWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SideWindowController.h; path = SideView/SideWindowController.h; sourceTree = "<group>"; };
173858990E0D92DD00488CD4 /* SideWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SideWindowController.m; path = SideView/SideWindowController.m; sourceTree = "<group>"; };
173A439F0F3FD26500676A7B /* ToolTipWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolTipWindow.h; path = ToolTip/ToolTipWindow.h; sourceTree = "<group>"; };
173A43A00F3FD26500676A7B /* ToolTipWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ToolTipWindow.m; path = ToolTip/ToolTipWindow.m; sourceTree = "<group>"; };
173A43B60F3FD3B200676A7B /* VolumeButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VolumeButton.h; sourceTree = "<group>"; };
173A43B70F3FD3B200676A7B /* VolumeButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VolumeButton.m; sourceTree = "<group>"; };
1752C6AE0F3FE3CC00FC3235 /* VolumeSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VolumeSlider.h; sourceTree = "<group>"; };
1752C6AF0F3FE3CC00FC3235 /* VolumeSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VolumeSlider.m; sourceTree = "<group>"; };
1755E1F60BA0D2B600CA3560 /* PlaylistLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlaylistLoader.h; sourceTree = "<group>"; };
1755E1F70BA0D2B600CA3560 /* PlaylistLoader.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = PlaylistLoader.m; sourceTree = "<group>"; };
1766C68E0B911DF1004A7AE4 /* AudioScrobbler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioScrobbler.h; sourceTree = "<group>"; };
@ -790,6 +799,15 @@
name = "Other Frameworks";
sourceTree = "<group>";
};
173A439D0F3FD25500676A7B /* ToolTip */ = {
isa = PBXGroup;
children = (
173A439F0F3FD26500676A7B /* ToolTipWindow.h */,
173A43A00F3FD26500676A7B /* ToolTipWindow.m */,
);
name = ToolTip;
sourceTree = "<group>";
};
1766C68D0B911DF1004A7AE4 /* AudioScrobbler */ = {
isa = PBXGroup;
children = (
@ -819,6 +837,7 @@
177EBF770B8BC2A70000BC8C /* ThirdParty */ = {
isa = PBXGroup;
children = (
173A439D0F3FD25500676A7B /* ToolTip */,
178BAB920CD4E1B700B33D47 /* GCWindowMenu */,
177EBF7D0B8BC2A70000BC8C /* AppleRemote */,
177EBF850B8BC2A70000BC8C /* ImageTextCell */,
@ -878,6 +897,10 @@
17E78CB00D68D46F005C5A59 /* StringToURLTransformer.m */,
56AE86BF0D6901BC00B0F89B /* FontSizetoLineHeightTransformer.h */,
56AE86C00D6901BC00B0F89B /* FontSizetoLineHeightTransformer.m */,
173A43B60F3FD3B200676A7B /* VolumeButton.h */,
173A43B70F3FD3B200676A7B /* VolumeButton.m */,
1752C6AE0F3FE3CC00FC3235 /* VolumeSlider.h */,
1752C6AF0F3FE3CC00FC3235 /* VolumeSlider.m */,
);
path = Utils;
sourceTree = "<group>";
@ -1794,6 +1817,9 @@
1738589B0E0D92DD00488CD4 /* SideBarController.m in Sources */,
1738589D0E0D92DD00488CD4 /* SideWindowController.m in Sources */,
07D971E60ED1DAA800E7602E /* TagEditorController.m in Sources */,
173A43A10F3FD26500676A7B /* ToolTipWindow.m in Sources */,
173A43B80F3FD3B200676A7B /* VolumeButton.m in Sources */,
1752C6B00F3FE3CC00FC3235 /* VolumeSlider.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -1,26 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02">
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">9F33</string>
<string key="IBDocument.InterfaceBuilderVersion">667</string>
<string key="IBDocument.AppKitVersion">949.34</string>
<string key="IBDocument.HIToolboxVersion">352.00</string>
<string key="IBDocument.SystemVersion">9G55</string>
<string key="IBDocument.InterfaceBuilderVersion">677</string>
<string key="IBDocument.AppKitVersion">949.43</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="2187"/>
<integer value="1611"/>
<integer value="1610"/>
<integer value="463"/>
<integer value="57"/>
<integer value="2187"/>
<integer value="1324"/>
<integer value="206"/>
<integer value="513"/>
<integer value="2212"/>
<integer value="268"/>
<integer value="57"/>
<integer value="513"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="652455320">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="427215711">
@ -78,9 +88,10 @@
<string key="NSToolbarItemPaletteLabel">Search</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSearchField" key="NSToolbarItemView" id="753327466">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{0, 14}, {96, 22}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSearchFieldCell" key="NSCell" id="284278117">
<int key="NSCellFlags">343014976</int>
@ -177,9 +188,10 @@
<string key="NSToolbarItemPaletteLabel">Position</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSlider" key="NSToolbarItemView" id="505703107">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">270</int>
<string key="NSFrame">{{0, 14}, {96, 15}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSliderCell" key="NSCell" id="543888159">
<int key="NSCellFlags">604372736</int>
@ -205,7 +217,7 @@
<nil key="NSToolbarItemTarget"/>
<nil key="NSToolbarItemAction"/>
<string key="NSToolbarItemMinSize">{96, 15}</string>
<string key="NSToolbarItemMaxSize">{10000, 15}</string>
<string key="NSToolbarItemMaxSize">{96, 15}</string>
<bool key="NSToolbarItemEnabled">NO</bool>
<bool key="NSToolbarItemAutovalidates">YES</bool>
<int key="NSToolbarItemTag">0</int>
@ -220,9 +232,10 @@
<string key="NSToolbarItemPaletteLabel">Info Drawer</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="593720571">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{23, 14}, {24, 25}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1048031545">
<int key="NSCellFlags">67239424</int>
@ -261,9 +274,10 @@
<string key="NSToolbarItemPaletteLabel">Shuffle</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="865953109">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{10, 14}, {24, 25}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="141286620">
<int key="NSCellFlags">67239424</int>
@ -302,9 +316,10 @@
<string key="NSToolbarItemPaletteLabel">Volume</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="805617126">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{12, 14}, {24, 25}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="980041866">
<int key="NSCellFlags">67239424</int>
@ -343,9 +358,10 @@
<string key="NSToolbarItemPaletteLabel">File Tree</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="56892805">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{14, 14}, {24, 25}}</string>
<string key="NSFrame">{{15, 14}, {24, 25}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="144841221">
<int key="NSCellFlags">67239424</int>
@ -384,9 +400,10 @@
<string key="NSToolbarItemPaletteLabel">Playback Buttons</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSSegmentedControl" key="NSToolbarItemView" id="40234197">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{9, 14}, {80, 24}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="477857375">
<int key="NSCellFlags">-2080244224</int>
@ -450,9 +467,10 @@
<string key="NSToolbarItemPaletteLabel">Current Time</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSTextField" key="NSToolbarItemView" id="362320150">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 14}, {38, 14}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="511447813">
<int key="NSCellFlags">67239488</int>
@ -491,9 +509,10 @@
<string key="NSToolbarItemPaletteLabel">Repeat</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="557152416">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{10, 14}, {24, 25}}</string>
<reference key="NSSuperview"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="758905654">
<int key="NSCellFlags">67239424</int>
@ -3316,7 +3335,7 @@ OQA</bytes>
<string key="NSClassName">FileTreeDataSource</string>
</object>
<object class="NSCustomView" id="109024969">
<nil key="NSNextResponder"/>
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -3344,6 +3363,7 @@ OQA</bytes>
</object>
</object>
<string key="NSFrameSize">{97, 177}</string>
<reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomObject" id="1030351520">
@ -4698,14 +4718,6 @@ OQA</bytes>
</object>
<int key="connectionID">1615</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_popView</string>
<reference key="source" ref="805617126"/>
<reference key="destination" ref="964856847"/>
</object>
<int key="connectionID">1616</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: arrangedObjects.length</string>
@ -6243,6 +6255,14 @@ OQA</bytes>
</object>
<int key="connectionID">2219</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_popView</string>
<reference key="source" ref="805617126"/>
<reference key="destination" ref="964856847"/>
</object>
<int key="connectionID">2220</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -7614,7 +7634,7 @@ OQA</bytes>
<reference ref="964856847"/>
</object>
<reference key="parent" ref="293114310"/>
<string key="objectName">Popup View</string>
<string key="objectName">Volume View</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">1612</int>
@ -8538,10 +8558,10 @@ OQA</bytes>
<string>1518.ImportedFromIB2</string>
<string>1519.IBPluginDependency</string>
<string>1519.ImportedFromIB2</string>
<string>1523.IBEditorWindowLastContentRect</string>
<string>1523.IBPluginDependency</string>
<string>1523.ImportedFromIB2</string>
<string>1523.editorWindowContentRectSynchronizationRect</string>
<string>1529.IBPluginDependency</string>
<string>1529.ImportedFromIB2</string>
<string>1531.IBPluginDependency</string>
<string>1531.ImportedFromIB2</string>
@ -8563,7 +8583,6 @@ OQA</bytes>
<string>1550.ImportedFromIB2</string>
<string>1551.IBPluginDependency</string>
<string>1551.ImportedFromIB2</string>
<string>1552.IBPluginDependency</string>
<string>1552.ImportedFromIB2</string>
<string>156.IBPluginDependency</string>
<string>156.ImportedFromIB2</string>
@ -8587,9 +8606,11 @@ OQA</bytes>
<string>1609.ImportedFromIB2</string>
<string>1610.IBPluginDependency</string>
<string>1610.ImportedFromIB2</string>
<string>1611.IBEditorWindowLastContentRect</string>
<string>1611.IBPluginDependency</string>
<string>1611.ImportedFromIB2</string>
<string>1611.editorWindowContentRectSynchronizationRect</string>
<string>1612.CustomClassName</string>
<string>1612.IBPluginDependency</string>
<string>1612.ImportedFromIB2</string>
<string>1613.IBPluginDependency</string>
@ -8626,11 +8647,11 @@ OQA</bytes>
<string>1642.ImportedFromIB2</string>
<string>1645.IBPluginDependency</string>
<string>1645.ImportedFromIB2</string>
<string>1673.IBPluginDependency</string>
<string>1675.IBPluginDependency</string>
<string>1683.IBPluginDependency</string>
<string>1685.IBPluginDependency</string>
<string>1688.IBPluginDependency</string>
<string>1689.IBPluginDependency</string>
<string>169.IBEditorWindowLastContentRect</string>
<string>169.IBPluginDependency</string>
<string>169.ImportedFromIB2</string>
@ -8639,10 +8660,14 @@ OQA</bytes>
<string>1701.IBPluginDependency</string>
<string>171.IBPluginDependency</string>
<string>171.ImportedFromIB2</string>
<string>1712.IBPluginDependency</string>
<string>1713.IBPluginDependency</string>
<string>172.IBPluginDependency</string>
<string>172.ImportedFromIB2</string>
<string>173.IBPluginDependency</string>
<string>173.ImportedFromIB2</string>
<string>1736.IBPluginDependency</string>
<string>1737.IBPluginDependency</string>
<string>1740.IBPluginDependency</string>
<string>1741.IBPluginDependency</string>
<string>1741.editorWindowContentRectSynchronizationRect</string>
@ -8651,6 +8676,7 @@ OQA</bytes>
<string>1748.IBPluginDependency</string>
<string>1749.IBPluginDependency</string>
<string>1791.IBPluginDependency</string>
<string>1798.IBPluginDependency</string>
<string>1801.IBPluginDependency</string>
<string>1823.IBPluginDependency</string>
<string>1823.ImportedFromIB2</string>
@ -8710,13 +8736,13 @@ OQA</bytes>
<string>209.IBPluginDependency</string>
<string>209.ImportedFromIB2</string>
<string>21.IBEditorWindowLastContentRect</string>
<string>21.IBPluginDependency</string>
<string>21.IBWindowTemplateEditedContentRect</string>
<string>21.ImportedFromIB2</string>
<string>21.NSWindowTemplate.visibleAtLaunch</string>
<string>21.editorWindowContentRectSynchronizationRect</string>
<string>21.windowTemplate.hasMaxSize</string>
<string>21.windowTemplate.maxSize</string>
<string>2123.IBPluginDependency</string>
<string>2155.IBPluginDependency</string>
<string>2156.IBPluginDependency</string>
<string>2157.IBEditorWindowLastContentRect</string>
@ -8733,7 +8759,6 @@ OQA</bytes>
<string>218.IBPluginDependency</string>
<string>218.ImportedFromIB2</string>
<string>2187.IBEditorWindowLastContentRect</string>
<string>2187.IBPluginDependency</string>
<string>2187.IBWindowTemplateEditedContentRect</string>
<string>2187.NSWindowTemplate.visibleAtLaunch</string>
<string>2188.IBPluginDependency</string>
@ -8768,7 +8793,6 @@ OQA</bytes>
<string>24.ImportedFromIB2</string>
<string>24.editorWindowContentRectSynchronizationRect</string>
<string>268.IBEditorWindowLastContentRect</string>
<string>268.IBPluginDependency</string>
<string>268.IBWindowTemplateEditedContentRect</string>
<string>268.ImportedFromIB2</string>
<string>268.editorWindowContentRectSynchronizationRect</string>
@ -8794,7 +8818,6 @@ OQA</bytes>
<string>276.ImportedFromIB2</string>
<string>277.IBPluginDependency</string>
<string>277.ImportedFromIB2</string>
<string>280.IBPluginDependency</string>
<string>280.ImportedFromIB2</string>
<string>280.windowTemplate.hasMaxSize</string>
<string>280.windowTemplate.hasMinSize</string>
@ -9105,10 +9128,10 @@ OQA</bytes>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{140, 396}, {617, 227}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{85, 558}, {617, 0}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
@ -9130,7 +9153,6 @@ OQA</bytes>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
@ -9147,16 +9169,18 @@ OQA</bytes>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>PopupButton</string>
<string>VolumeButton</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{0, 818}, {97, 177}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{37, 809}, {97, 177}}</string>
<string>VolumeSlider</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -9207,11 +9231,15 @@ OQA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{675, 786}, {186, 93}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -9220,6 +9248,7 @@ OQA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
@ -9277,7 +9306,6 @@ OQA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{103, 226}, {691, 397}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{103, 226}, {691, 397}}</string>
<reference ref="9"/>
<reference ref="9"/>
@ -9286,6 +9314,7 @@ OQA</bytes>
<string>{3.40282e+38, 3.40282e+38}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{603, 670}, {64, 6}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -9300,7 +9329,6 @@ OQA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{92, 297}, {480, 270}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{92, 297}, {480, 270}}</string>
<reference ref="8"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -9335,7 +9363,6 @@ OQA</bytes>
<reference ref="9"/>
<string>{{442, 733}, {197, 103}}</string>
<string>{{314, 416}, {480, 376}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{314, 416}, {480, 376}}</string>
<reference ref="9"/>
<string>{{139, 290}, {480, 376}}</string>
@ -9361,7 +9388,6 @@ OQA</bytes>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<reference ref="8"/>
<reference ref="9"/>
@ -9521,7 +9547,7 @@ OQA</bytes>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">2219</int>
<int key="maxID">2220</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -10235,6 +10261,22 @@ OQA</bytes>
<string key="minorKey"/>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VolumeButton</string>
<string key="superclassName">PopupButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Utils/VolumeButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VolumeSlider</string>
<string key="superclassName">NSSlider</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">Utils/VolumeSlider.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>

View File

@ -258,7 +258,7 @@
NSLog(@"starting tracking; initial event = %@", event);
//[NSEvent startPeriodicEventsAfterDelay:1.0 withPeriod:0.1];
// [NSEvent startPeriodicEventsAfterDelay:1.0 withPeriod:0.1];
NSTimeInterval startTime = [event timestamp];
@ -292,7 +292,7 @@
switch ([theEvent type])
{
case NSMouseMovedMask:
case NSMouseMoved:
[[self mainView] mouseMoved:theEvent];
break;

View File

@ -35,5 +35,4 @@
[self highlight:NO];
}
@end

38
ThirdParty/ToolTip/ToolTipWindow.h vendored Normal file
View File

@ -0,0 +1,38 @@
//
// ToolTip.h
// Cog
//
// Created by Vincent Spader on 2/8/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
// From http://www.cocoadev.com/index.pl?ToolTip
#import <AppKit/AppKit.h>
@interface ToolTipWindow : NSWindow
{
id closeTimer;
id tooltipObject;
NSColor *backgroundColor;
NSDictionary *textAttributes;
}
// returns the approximate window size needed to display the tooltip string.
- (NSSize)suggestedSizeForTooltip:(id)tooltip;
// setting and getting the bgColor
- (void)setBackgroundColor:(NSColor *)bgColor;
- (NSColor *)backgroundColor;
- (id)init;
- (id)toolTip;
- (void)setToolTip:(id)tip;
- (void)orderFront;
- (void)orderFrontForDuration:(NSTimeInterval)duration;
@end

123
ThirdParty/ToolTip/ToolTipWindow.m vendored Normal file
View File

@ -0,0 +1,123 @@
#import "ToolTipWindow.h"
@implementation ToolTipWindow
- (void)setBackgroundColor:(NSColor *)bgColor
{
[backgroundColor release];
backgroundColor = [bgColor retain];
}
- (NSColor *)backgroundColor
{
return backgroundColor;
}
- (NSSize)suggestedSizeForTooltip:(id)tooltip
{
NSSize tipSize = NSZeroSize;
if ([tooltip isKindOfClass:[NSAttributedString class]]) {
tipSize = [tooltip size];
}
else if ([tooltip isKindOfClass:[NSString class]]){
tipSize = [tooltip sizeWithAttributes:textAttributes];
}
if (!NSEqualSizes(tipSize, NSZeroSize))
tipSize.width += 4;
return tipSize;
}
- (id)init
{
self = [super initWithContentRect:NSMakeRect(0,0,0,0)
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
{ // window setup...
[self setAlphaValue:0.90];
[self setOpaque:NO];
[self setHasShadow:YES];
[self setBackgroundColor:[NSColor colorWithDeviceRed:1.0 green:0.96 blue:0.76 alpha:1.0]];
[self setLevel:NSStatusWindowLevel];
[self setHidesOnDeactivate:YES];
[self setIgnoresMouseEvents:YES];
[self setReleasedWhenClosed:NO];
}
{ // textfield setup...
NSTextField *field = [[NSTextField alloc] initWithFrame:NSMakeRect(0,0,0,0)];
[field setEditable:NO];
[field setSelectable:NO];
[field setBezeled:NO];
[field setBordered:NO];
[field setDrawsBackground:NO];
[field setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[self setContentView:field];
[self setFrame:[self frameRectForContentRect:[field frame]] display:NO];
[field setStringValue:@" "]; // Just having at least 1 char to allow the next message...
textAttributes = [[[field attributedStringValue] attributesAtIndex:0 effectiveRange:nil] retain];
[field release];
}
return self;
}
- (void)dealloc
{
if (closeTimer) {
[closeTimer invalidate];
[closeTimer release];
}
[tooltipObject release];
[super dealloc];
}
- (id)toolTip { return tooltipObject; }
- (void)setToolTip:(id)tip
{
id contentView = [self contentView];
[tooltipObject release];
tooltipObject = [tip retain];
if ([contentView isKindOfClass:[NSTextField class]]) {
if ([tip isKindOfClass:[NSString class]]) [contentView setStringValue:tip];
else
if ([tip isKindOfClass:[NSAttributedString class]]) [contentView setAttributedStringValue:tip];
}
}
- (void)orderFrontForDuration:(NSTimeInterval)duration
{
[self orderFront:nil];
if (closeTimer) { [closeTimer invalidate]; [closeTimer release]; }
closeTimer = [[NSTimer scheduledTimerWithTimeInterval:duration target:self selector:@selector(close) userInfo:nil repeats:NO] retain];
}
- (void)orderFront
{
if (closeTimer) { [closeTimer invalidate]; [closeTimer release]; closeTimer = nil; }
[super orderFront:nil];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"TooltipWindow:\n%@", [[self contentView] stringValue]];
}
@end

14
Utils/VolumeButton.h Normal file
View File

@ -0,0 +1,14 @@
//
// VolumeButton.h
// Cog
//
// Created by Vincent Spader on 2/8/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "PopupButton.h"
@interface VolumeButton : PopupButton {
}
@end

29
Utils/VolumeButton.m Normal file
View File

@ -0,0 +1,29 @@
//
// VolumeButton.m
// Cog
//
// Created by Vincent Spader on 2/8/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "VolumeButton.h"
#import "VolumeSlider.h"
@implementation VolumeButton
- (void)scrollWheel:(NSEvent *)theEvent
{
[(VolumeSlider *)_popView showToolTipForDuration:1.0];
}
- (void)mouseDown:(NSEvent *)theEvent
{
[(VolumeSlider *)_popView hideToolTip];
[super mouseDown:theEvent];
[(VolumeSlider *)_popView hideToolTip];
}
@end

20
Utils/VolumeSlider.h Normal file
View File

@ -0,0 +1,20 @@
//
// VolumeSlider.h
// Cog
//
// Created by Vincent Spader on 2/8/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "ToolTipWindow.h"
@interface VolumeSlider : NSSlider {
ToolTipWindow *toolTip;
}
- (void)showToolTip;
- (void)showToolTipForDuration:(NSTimeInterval)duration;
- (void)hideToolTip;
@end

87
Utils/VolumeSlider.m Normal file
View File

@ -0,0 +1,87 @@
//
// VolumeSlider.m
// Cog
//
// Created by Vincent Spader on 2/8/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "VolumeSlider.h"
#import "CogAudio/Helper.h"
@implementation VolumeSlider
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
toolTip = [[ToolTipWindow alloc] init];
}
return self;
}
- (id)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self)
{
toolTip = [[ToolTipWindow alloc] init];
}
return self;
}
- (void)updateToolTip
{
double value = [self doubleValue];
double volume = linearToLogarithmic(value);
NSString *text = [[NSString alloc] initWithFormat:@"%0.lf", volume];
NSSize size = [toolTip suggestedSizeForTooltip:text];
NSPoint mouseLocation = [NSEvent mouseLocation];
[toolTip setToolTip:text];
[toolTip setFrame:NSMakeRect(mouseLocation.x, mouseLocation.y, size.width, size.height) display:YES];
[text release];
}
- (void)showToolTip
{
[self updateToolTip];
[toolTip orderFront];
}
- (void)showToolTipForDuration:(NSTimeInterval)duration
{
[self updateToolTip];
[toolTip orderFrontForDuration:duration];
}
- (void)hideToolTip
{
[toolTip close];
}
- (BOOL)sendAction:(SEL)theAction to:(id)theTarget
{
double oneLog = logarithmicToLinear(100.0);
double distance = [self frame].size.height*([self doubleValue] - oneLog)/100.0;
if (fabs(distance) < 2.0)
{
[self setDoubleValue:oneLog];
}
[self showToolTip];
return [super sendAction:theAction to:theTarget];
}
@end