Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Haha ok. I almost feel flattered :D.
So, where're you coming from if i may ask?

That's a lot of stuff you plan to do. My TODO is it is quite simple. Fix all those little bugs and refine the UI.
All secondary windows havent been overhauled yet. Plus i still need to add autolayout for the remaining FX tabs.

Also i would really like to split apart all those window views in the MainMenu.xib, but i haven't really figured out a way to do just that without having to redo all the bindings and stuff. This is a bit too complex for me, so I'll probably let that one slip and stay focused on the UI stuff for now. And while doing that fixing broken and simplifying existing code seems fine and helps me understand stuff more deeply.

Considering pressure and pace, I know theres not duty to fulfill here. It's just better learning how to code, which is a new found hobby of mine. Even though i probably have to take a step back for a while. I just finished studying mechanical engineering and have other obligations at the moment :rolleyes:

Regarding the last BONUS task:
Not sure if AudioKit which is also written in Swift could achieve better performance. There's the app Phonix which i also found here on macrumors right before I came across you thread. Phonix does have 3rd party implementation of a spectrum analyzer and volume meters. Even with that the CPU stays about 14% which is totally ok. And the visualisation is also super smooth. In the about section there's a list of all the frameworks he has used.

Really looking forward to merging your updates, espacially the drag&drop and move events.
 
new test release up and running. The changelog is pretty decent I guess.
Hope you like it :p

https://github.com/Dunkeeel/aural-player/releases/tag/0.2.0

what's new:

  • finished the UI for main and playlist window
  • added playing indicator to playlist
  • fixed album art not hiding
  • removed jump up/down buttons (still available in the menu and with shortcut)
  • added gap to the dock and resize function
  • reimplemented the playlist alignment when main window changes height while playlist is docked at the bottom (size independent + a whole lot easier)
  • cleaned up some code
  • and much more
screenshot:
screenshot_60.png
 
Last edited:
  • Like
Reactions: PBG4 Dude
Tobias, thanks for the updates. I do have some feedback on your work, but I'm quite busy wrapping up work on my end, hence the silence. Will get back to you soon.

I'll just say this now - I'm really glad I insisted on keeping our work in separate branches :)
 
Thanks, I'm really looking forward to hearing the feedback from you. The more critical the better. That way i can learn my mistakes and avoid them in the future. Since I'm still pretty new when it comes to programming in general there sure is a lot of stuff thats not best practice or poorly executed. That's why I even have a separate test branch myself besides the swift 4 one. Swift 4 branch is still unchanged from your latest release besides the conversion.

Also since Swift 4 is that new, it's always better to have it a separate branch due to lacking support and errors introduced by the language itself.

In the mean time I made a workaround to get the application show up again from the dock. Somehow, the window management in this app is totally weird and different from what I am used to.
Also fixed some obvious stuff I ****ed up in the previous build (like missing dock icons in the playlist).

Do you know how to get rid of forcing the main window to the front? Wouldn't it be better to have the active window in front? Or the playlist in general, since I can at close the playlist separate from the main window, but not the other way around.
 
Wow, looking good. Will try to merge the changes as soon as you're finished. Is this a tabbed view now, or do the buttons just change the single table view?

Also, I found a bug which exists on both our versions.
When you close the lid and then wake up from sleep, you can't play any audio anymore. Docking buttons still work, as well as the close button, but clicking the play button or double clicking a track in the playlist doesn't do anything until you restart the app.

And when I built your latest source, the minimize button still doesn't work for me, so its not related to the swift 4 conversion.
 
Wow, looking good. Will try to merge the changes as soon as you're finished. Is this a tabbed view now, or do the buttons just change the single table view?

Also, I found a bug which exists on both our versions.
When you close the lid and then wake up from sleep, you can't play any audio anymore. Docking buttons still work, as well as the close button, but clicking the play button or double clicking a track in the playlist doesn't do anything until you restart the app.

And when I built your latest source, the minimize button still doesn't work for me, so its not related to the swift 4 conversion.

It's a tabbed view with no tabs displayed, i.e. "tabless" style. The buttons are just simple push buttons with a custom button cell that I wrote (same cells are used in effects panel tab view) for custom look n feel.

Yes, I did encounter that audio bug once or twice, but didn't look into it. The solution might lie in pausing/resuming the audio engine when going to sleep and waking up. Look in classes AudioGraph and AudioEngineHelper. Need to also look at AVAudioEngine docs.

BTW, my latest source on master is going to be quite ugly as I finish up grouped views (artist, album, etc). I suggest you wait a few days to pick up my changes. Master branch is an experimental mess right now, but that is intentional because I want to make these updates incrementally and I don't want the hassle of a new branch.
 
Do you know how to get rid of forcing the main window to the front? Wouldn't it be better to have the active window in front? Or the playlist in general, since I can at close the playlist separate from the main window, but not the other way around.

The main window is supposed to be the key window, and hence be in front all the time. Why should it be otherwise ? The main window represents the app. I wouldn't want some secondary window taking the focus. The playlist window is a child of the main window.

Now, if the main window is taking up too much space, it can be made more compact by hiding FX. If that's not enough, maybe we can add the ability to hide the player controls as well.

I don't understand why you would want the playlist window to take up the whole screen or be in focus ?
 
The main window is supposed to be the key window, and hence be in front all the time. Why should it be otherwise ? The main window represents the app. I wouldn't want some secondary window taking the focus. The playlist window is a child of the main window.

Now, if the main window is taking up too much space, it can be made more compact by hiding FX. If that's not enough, maybe we can add the ability to hide the player controls as well.

I don't understand why you would want the playlist window to take up the whole screen or be in focus ?

Well, since you can close the playlist separately to the main window, in case those windows overlap you cannot access the playlist anymore. I solved this now by adding the dock functions to the main window. That was only the first reason.

Second reason would be, that for many people the main window wouldn't neccessarily be the key window in a music player. For me for example, the playlist is where most of the stuff happens. You add music to it, select tracks, play tracks by double-clicking, reorder tracks, remove tracks. The player controls aren't really that important for me personally. Most of the time when I play music, I wanna choose specific songs I want to hear at the moment, or play and pause the music. All that can be done without the main window. Well, in case theres support for media keys (that's the next thing i'll try to add) or a menu bar widget.

A fullscreen playlist/library can also give a much better overview of the song collection. With that additional space you could either show more information on the tracks with additional columns in the table view, or even switch to a collection view, so you have all the Artists/Albums/Genres in a nice grid layout.

In my opinion, a really cool thing would be to have the player controls on the main window with an option for a fullscreen playlist/library in a second "Space", easily accessible by 4-finger swiping on the trackpad.

So, at least I explained myself now :)


Coming back to development, I have released a third test build today. This is the changelog:

- some UI changes (moved docking buttons to the main window)
- fixed some bugs related to auto-layout (main window and playlist can be made even smaller now, for a more compact player)
- improved docking (main window moves away from the screen edge to make some space for the playlist in case it gets docked to the outside)
- window positions as well as playlistDockState now get saved when closing and restored when opening the app

https://github.com/Dunkeeel/aural-player/releases/tag/0.3.0

Edit:
Also added a run script to show todo's as warnings, so you can find them more easily. Pretty handy.
Check this out: https://bendodson.com/weblog/2014/1...arning-in-swift-xcode-project/#fnref:comments
 
Last edited:
  • Like
Reactions: 0002378
Ah ok. Yes, that makes sense, but I would still want the main window to be visible :)

With the huge screen resolutions that are common today (keep in mind I'm working on a 2009 MBP with 1280 x 800 and I think it's more than sufficient real estate for both the playlist and main windows).

I like your idea of showing the playlist in a grid layout, with more info like iTunes does. I just don't know how much work it will take to change the UI to do so, and whether the work will be worth it.

If you read my GitHub main page, the goal of this app was to provide a simple Winamp replacement on Mac. I don't know if making it more like iTunes contradicts that goal. Maybe, maybe not. It's worth a try, I suppose.

Yes, maybe we can allow the playlist to become the key window ... I just don't know how that will impact the rest of the windowing of the app (I don't know much about windowing).

I think the following should be all that's required:
playlistWindow.makeKeyAndOrderFront(self) ... // When user is playing with the playlist

BTW, I tried to add media key support. I got it working, but the only problem was that it would also send key events to iTunes and iTunes would also start playing. I did some research and answers online pointed to the implementation by VLC (i.e. they've done it right) as a reference, but I didn't bother looking at it. Yes, it can be a good project for you. It is fairly straightforward to add the support. It is not so straightforward to prevent the keys from triggering iTunes :D

P.S. I haven't looked at your changes because I'm still busy wrapping up group views. But, your changelist looks great ! Great work ! I'm really looking forward to someday merging our work.
 
well with an MVC pattern it could be a little bit of work to make the collection view. But considering a MVVM pattern and having a view-model that prepares all the information from the model, ready to use for the view-controller, which only job would be to pass that data to the actual view (be it a collection view, or a table doesn't matter) and delegate user input back to the view-model. At least that's how I understand MVVM works. So kind of separating the app logic from the UI.

makeKeyAndOrderFront doesn't work in that case, since the app behaves totally weird in terms of window management. I don't even understand it correctly, since there's not even a windowController and only one windowDelegate which is assigned to the playlistWindow. For example viewDidResize only gets fired for the playlist. Just put print("resize") in there and you will see it only displayed when resizing the playlist.

So theres probably the need for splitting the WindowViewController in a MainViewController and a dedicated MainWindowController. Maybe something like this just with windows instead of views?:
https://codereview.stackexchange.co...-controllers-in-a-single-window-swift-on-os-x

But right now I'm already in the process of reading the Apple Documentation regarding Window Programming.

For the media keys I will have a look at the IINA source code. Maybe I'll find something there, since it also prevents iTunes from firing up.
 
Haha ok. I almost feel flattered :D.
So, where're you coming from if i may ask?

Ich wohne in eine kleine Stadt in der Nähe von Los Angeles. Didn't you read my location under my username on the left ? Die Bundesstaat Kalifornien ;)

To be honest, some of the most intriguing and intelligent people I have met and worked with (at my previous company) were German. One of my closest friends is German, and I have also dated a German woman ... and wow :D Auch, war ich für eine Woche im Jahr 2012 in Deutschland ... ein schönes Land.

Anyway, I am making progress with grouped views, but not as fast as I would have liked. NSOutlineView has been a constant pain in mein arsch ! Will keep you updated.
[doublepost=1508925303][/doublepost]In response to some comments about the outdated looking UI, I do agree that it doesn't look all that flashy. But, I actually like it because I'm very much simplicity-oriented, coming from Winamp on Windows. (And, in fact, the mission/goal for this project was just that - simplicity.)

L - Load tracks
V - Stop playing
B - Next track
Shift V - Fade to stop

(God bless you, and R.I.P., Winamp)

As for the UI, sure, it could look better, but I really like the simplicity of just loading tracks and playing. Whatever else happens is a bonus :D
 
Last edited:
This is very cool, will be sure to give it a download later on today. Any chance of integrating last.fm scrobbling? :cool:

Thanks ! Hmm, now that you mention it, I will look into it. I had to look up what "scrobbling" means. Yes, I'm old-fashioned that way. I don't think I have ever used an online streaming service other than Sirius satellite radio.

You mean sending info to last.fm, right ? As opposed to playing a stream from there ?
 
  • Like
Reactions: terrybutcher
Exactly that, sending the tracks played to my last.fm account. With players like Spotify you pop your login details in and the tracks played then add to your listening history. iTunes you have to run a separate application (i can’t remember the name of the one I use at the moment, but want rid of iTunes for my local music!).

If you can achieve it that would be amazing. Downloading the app in a few hours time, looks great. Top work! Roll on the last.fm integration ☺️
 
  • Like
Reactions: 0002378
well with an MVC pattern it could be a little bit of work to make the collection view.

Tobias, I wanted to give you a quick update ...

- Almost done with grouping views CRUD. Add/remove/reordering done, updating pending (i.e. the U in CRUD)
- Searching and sorting grouping views almost done.
- Still need to implement changes to playback sequencing (new playback/repeat/shuffle modes ?)
- Cleanup and testing pending.
- UI touching up pending

This whole grouping views work is a BIG change ! I mean ... monumental.

Once all that is done, I will finish up some of the more minor changes from my TODOs list.

After all that is done, I was thinking about creating that Swift4 branch in my repo, which, as I suggested, could be a melting pot where we merge both your changes and mine, and the whole thing will be in Swift4. Your original branch and my master branch can remain unchanged. Every once in a while, we can get in touch and work together to merge new updates into this new branch.

And, we can publish two builds - a stable one and an experimental one.
 
Wow, you're making great progress. Haven't had that much time to code lately.
Only created an adaptive menu bar icon and made sort view a popover. Maybe I'll change the search window too, but not sure about that.

screenshot_61.png


Also split up every window in a separate .xib file. Somehow I don't like to have all in one file.
With that, I had to do some work to get everything working again. Right now I have to rebind all the menu bar items, which I will do in a dedicated menu bar controller. The only other thing that's not working is playing a track from the playlist by double clicking. Not sure why it doesn't work anymore, but will take care of that next.
 
  • Like
Reactions: 0002378
Wow dude, you do have a keen eye for UI :)

The sort popover is a fantastic idea, and it looks beautiful ! The Sort and Cancel buttons look gorgeous ! They probably hate me because I had made them look so ugly :D

The search dialog should probably not cover the playlist, because items will be selected there (search results), but it can also be a popover as long as it is shown outside the playlist window.

Also, how did you get the rounded window corners ? I tried a few times, but the solution I found was really involved and I didn't bother implementing.

Preferences window also looks better your way. But, we can still keep my slider look n feel, right ? No need to have the boring circular knobs ?
 
Last edited:
Wow dude, you do have a keen eye for UI :)

The sort popover is a fantastic idea, and it looks beautiful ! The Sort and Cancel buttons look gorgeous ! They probably hate me because I had made them look so ugly :D

The search dialog should probably not cover the playlist, because items will be selected there (search results), but it can also be a popover as long as it is shown outside the playlist window.

Also, how did you get the rounded window corners ? I tried a few times, but the solution I found was really involved and I didn't bother implementing.

Preferences window also looks better your way. But, we can still keep my slider look n feel, right ? No need to have the boring circular knobs ?

Thanks for the feedback, but I haven't really designed anything :rolleyes:. Sort and Canel button are default design. So are rounded corners. So I wonder why you ask :D.

That's why I haven't made the search window a popover yet, because it would cover the playlist too much. So, it's probably better for it to stay a window.

For preferences I wanted to stick with the system's default UI for convenience. But I could change the slider back if you like.
 

Does this screenshot mean you're finished with the grouping views? Already tested your newes build and they seem to work fine on my side, besides the duration column that isn't "docked" to the right on some views.

Also you should change your swap function to resolve some problems with simultaneous access.

so change:
swap(&tracks[trackIndex1], &tracks[trackIndex2])
to:
tracks.swapAt(trackIndex1, trackIndex2)
and everything works fine.

Meanwhile I have fixed my problems with the playlist doubleAction and replaced my test branch with a new one, since merging wasn't possible due to the restructure. Now everything is working as it should and I'm ready to implement your new features :D
 
Does this screenshot mean you're finished with the grouping views? Already tested your newes build and they seem to work fine on my side, besides the duration column that isn't "docked" to the right on some views.

Also you should change your swap function to resolve some problems with simultaneous access.

so change:
swap(&tracks[trackIndex1], &tracks[trackIndex2])
to:
tracks.swapAt(trackIndex1, trackIndex2)
and everything works fine.

Meanwhile I have fixed my problems with the playlist doubleAction and replaced my test branch with a new one, since merging wasn't possible due to the restructure. Now everything is working as it should and I'm ready to implement your new features :D

Hmm, actually, as I mentioned before, this code is incomplete, so I wouldn't bother looking through it at that point.

Also, the correct solution is not to use the tracks.swapAt() method (array is not thread-safe, besides swapAt() is not available in Swift 3), but to synchronize access to the surrounding method itself, using either a serial queue or :

Code:
objc_sync_enter(lock)
        method()
        objc_sync_exit(lock)

I haven't synchronized all the necessary methods yet. Some are, some aren't.

I'm still working on it. There's still quite a bit to do, so don't download the source yet.
 
For me swapAt worked fine when i replaced it in your source code, using Swift 3.2 though.

Ok thanks for clearing that up, wasn't sure if it's finished because of the screenshot you posted.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.