zakk4223 / CocoaSplit

Stream/record your desktop/webcam to twitch/owned etc.
351 stars 34 forks source link

[7e3cb56] Layout saving is inconsistent #71

Closed LordHDL closed 9 years ago

LordHDL commented 9 years ago

Sometimes it works, but it often reverts the changes I made. The only constant I've noticed is that making changes and then clicking another layout will always revert them. Happens with any kind of layout/source change except renaming the layout.

Suggestion, you might prevent changes from being reverted while CS is still running. Revert if the user quits without saving. Could also add a warning message before quitting in that instance.

zakk4223 commented 9 years ago

Here's how saving works currently:

The Staging layout is only saved if 1) you click the 'save' button or 2) you "Go Live" (go live essentially saves the layout in staging, and then restores it into live)

If modify the staging layout and then switch to another one in staging, those changes aren't saved.

The Live layout is saved: If you change the live layout, and when you quit.

I can have the staging side save when you change layouts or quit too. I think in that case the save button would need to become a 'revert changes' one, so you can at least back out your current set of changes if you really screw things up.

Ideally I'd like to end up with 'undo/redo' editor type functionality but that's a long ways off probably.

LordHDL commented 9 years ago

Here's an example of something I'm doing. Let's say I load CS but forgot to open my source application first. The layout appears black in CS. When I open the source, the layout is still black because it's deselected, so I go to the source tab and change "no value" to what I want.

I then want to save it, so I click either save or click go live. Sometimes when I switch to another layout and back, my changes were reverted despite saving. It also happens when saving, then quitting and relaunching CS.

But as I said, this is inconsistent. When it does work, it often keeps working so it's hard to reproduce. I still don't know what causes it to trigger, but when it does happen simply restarting CS doesn't fix it.

Edit: Managed to get a good video of it. I compiled 41cd0e0 first just to be sure: https://www.dropbox.com/s/ziqqhx1h4dnyazr/CS%20Saving.mp4?dl=0

Edit 2: Figured it out. It only happens when you make changes in the staging view and then use the save button, not when clicking go live or making changes in the live layout.

As an aside, it might be prudent to make any live changes apply immediately to layout previews, so that one might make certain changes in preview without being "out-of-date."

zakk4223 commented 9 years ago

I'm still trying to figure out how to fix this, but to help you avoid it:

The bug happens specifically when you switch the staging layout to the same one as the LIVE layout. Anytime you do that it saves the current live state of the layout and applies it to staging view.

I'm thinking that if you save the current live view in staging that might as well be the same thing as going live, but I'll see if I can approach it another way.

zakk4223 commented 9 years ago

I sorta took the long way around to fix this. Basically the live view can't be edited unless you are in the 'single view' mode. If you go into single view and edit the live layout and then go back to staging/live view mode the staging view will pick up the changes made in live (if it's the selected view in staging).

There's also a 'revert' button for layouts. So you can select a layout, make a bunch of changes, and then hit 'revert' and it'll go back to the last saved version of the layout.

Having the same view be editable in both staging and live was introducing too many weird save related edge cases so this is probably the best way to fix unexpected non-saving of layouts.

LordHDL commented 9 years ago

Yep, works fine so far.

There's a new crash, however, when you click Go Live: https://www.dropbox.com/s/647ap0aac1g87fh/CocoaSplit_2015-03-07-092023_HDLs-MacBook-Pro.crash?dl=0

Edit: Somehow the "Direction" value got changed to "No Value" even though that's not a listed option. Changing it to something normal prevents the crash.