Is this the total earnings for the quarter, the total earnings minus the
expenses, or some other measure?
Well, earnings is generally synonymous with profit, so it would be clearer to define it as revenue minus expenses, but before income tax and dividends are deducted. "Adjusted" net income means that the company has adjusted the actual net income for the period for non-recurring events.
Is this where the earnings from the price-to-earnings ratio comes from
The "earnings" in that formula is "earnings per share", but yes it is usually calculated from adjusted net income, although it depends on who's calculating the measure. The main requirement is that the measure be consistent when comparing companies (e.g. don't compare the ration using the unadjusted earnings of one company and the adjusted earnings of another) If you're comparing the ratio to other companies, or the market, it's generally wise to adjust for non-recurring events to understand the normal value of a company, but those adjustments should not be wholly discarded if they have a significant impact on future earnings.
(though multiplied by 4 quarters)?
It's more common to use the total earnings over the last 4 quarters ("trailing 12 months") rather then just multiplying the current quarter by 4, but yes it is annualized. However, there are also forward P/E ratios that use the expected earnings over the next 4 quarters, so again as long as it's used consistently and transparently, the actual formula can vary.