I'm sorry to hear about that situation with the swing Luis but that is fuel that you can use in your workouts.
I say to regain that motivation think of that incident and how it made you feel. Start picturing walking your daughter down the ailse, picture your sons graduation. If you stimulate the mind the body cannot fail. I've been a huge believer in this and I always have something on my mind during my workouts. Whether it's me on stage, working out with my future son/daughters which it may be whenever we have kids, helping out other people, leading by example and that's just the icing on the cake for some of my thoughts when ever I'm on the cardio machine for an hour straight looking at screens at my Gold's gym around 3-4:00 a.m. I have to agree it's not fun but have those images burned into your mind that that is why you are there and that you are there to live.
I always try to workout like it is the last day on earth... U know you won't have another chance at it so THIS IS IT!!! Make it the best damn workout as if you will never be back and repeat this daily, it helps trust me
To answer you question I would say both, if you are not a regular to the gym and even if you are, you can build and burn fat at the same time, it's just really hard to do for someone like myself because my body has adapted to the physical peaks. I would have to drastically manipulate my foods/diet/macros in order to make changes to my physique today but for a beginner changes will come like lightning, especially if they are strict. The diet is 80%+ on making those changes come true, the more you cheat the more setbacks you will have. Stay true to yourself and strong mentally and the diet is like getting back on the bike. Of course everyone is human and needs to cheat every once in a while but if you are 90%+ in the gym and eating healthy, SOMETHING will change, I guarantee.
So for building muscle, always keep a high protein diet, get your veggies in for good digestible fiber and some moderate carbs. Don't go crazy on the carbs but enough to keep you sane. You can still cut a good part of the weight with moderate carbs and until you see plateaus in dropping weight is where you should change the amount of carbs and adjust. Eat 6 meals daily, keep the metabolism hot, you don't wanna miss meals because you are forcing your body to burn calories on consumption, it's the best trick for cutting up and raising the metabolism and keeping you from craving bad foods and possible cheating and ditching the diet. Drink tons of water to keep water retention low and sodium levels flush, you don't wanna have misleading lbs fooling your mind that changes are not happening.
In short the more muscle a person has on their body the higher the metabolism is to burn fat, that person can probably get away with more cheat meals than you because they have a 90% to 10% ratio of muscle to fat. If they went to the gym the next couple days, a massive cheat that they had only a day ago probably wouldn't even hurt their progress. This is the level you would like to be at so you can maintain the physique easily and have little worries about getting back at it whenever it's gym time. A lot of people make the common mistake of just losing weight and they say "Oh I'll build muscle later once I get all the fat off" WRONG, it's actually harder from that point. People don't realize that whenever they are overweight it is easier to build muscle on the way down while cutting at the same time, I would just think of it as a bulk. Use that size and use that extra strength all the excess calories have given you and push the weights at the gym. You don't wanna lose weight to become a stick at the end of all this, it takes too much time and probably another few years to get where you really want to be.
I hope some of that helps, I'm always here...
Ski