Here's another talk that is better than the one I just gave you. On The Other Side of Anger.
Buddhism isn't going to come up with a solution to your custody case--to force the courts to rule i the way you want, or for your ex-wife to be reasonable. It can help you accept what happens (whatever happens), and be a better father to your daughter (whether you have full custody of her or not).
I guess I would ask yourself: what is the worst thing that could happen at this court hearing? and face that fear. (Go ahead and tell me what you are afraid might happen).
In the meantime, check out from the library or order: https://www.amazon.com/Who-Ordered-This-Truckload-Dung-ebook/dp/B004H1T4LE/ref=la_B001JSBNZI_1_1?s=books&ie=UTF8&qid=1470311100&sr=1-1#nav-subnav
Ajahn Brahm has a ton of good stories that I refer to all the time when I am going through stressful stuff. You can find the stories by listening to all his talks, but you have to listen through a lot of talks to hear them all!
One is "Good? Bad? Who Knows?"
A king was out hunting in the forest and cut his finger. He called the doctor to come look at his finger. The king wanted to know if his finger was going to be okay. The doctor shrugged and said, "Good? Bad? Who knows?"
The finger got infected and the doctor had to amputate the finger. The king was pretty mad. "Obviously this finger injury turned out to be really bad! You're fired!" The doctor just shrugged and said, "Good, bad, who knows?"
The next day the king was taken hostage by the tribe of cannibals. The cannibals were thrilled to hear that they'd captured a king. They only wanted to sacrifice the very best for their god, and a king was the very best! But then they realized he only had 9 fingers. What!? We can't sacrifice him now---he's not perfect, after all!
The cannibals let the king go free. He returned home and looked for the doctor. "Doctor, how can I thank you enough for cutting off this finger! I'm going to reward you beyond your wildest dreams!" The doctor just shrugged and said, "Good, bad, who knows?"
You don't know how the court case will go. It could be a blessing in disguise---something you look back on later and say, "I'm glad that happened, because it led to this other good thing happening."
Even if the judge went completely crazy and took away all custody and visitation from you (which I really can't see happening--I work with kids in the foster care system and judges will do anything they can to keep kids in contact with both parents)--it could work out in ways you can't imagine.
What can you control about the court case? Maybe not much. But you can control how you react to it. You can control working on being the best person you can be, so that you can model to your daughter how she can be the best person she can be. You might not be able to control where your daughter lives or who/what she is exposed to, but you can teach her the valuable life lessons to overcome any hardships she comes across in life.
And she will face hardships in life. All of us do. So focus on learning how to deal with those hardships so you can teach her how to do it too.
Here are all the talks by Ajahn Brahm, sorted by popularity. https://www.youtube.com/user/BuddhistSocietyWA/videos?view=0&sort=p&shelf_id=3
Listen to them as you drive to work. Let them percolate into your brain. :)